[Win32utils-devel] [ win32utils-Bugs-27973 ] Cannot create a task that runs on system startup

noreply at rubyforge.org noreply at rubyforge.org
Wed Jan 15 02:01:26 UTC 2014


Bugs item #27973, was opened at 2010-03-16 05:04
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=411&aid=27973&group_id=85

Category: win32-taskscheduler
>Group: Code
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Innes MacKenzie (innesm)
Assigned to: Daniel Berger (djberg96)
Summary: Cannot create a task that runs on system startup

Initial Comment:
When I try to create a task that runs on system startup:

    require 'win32/taskscheduler'
    include Win32
    ts = TaskScheduler.new
    trigger = { :trigger_type => TaskScheduler::TASK_EVENT_TRIGGER_AT_SYSTEMSTART }
    ts.new_work_item('xyz1234', trigger)


I get an error:

C:/Ruby19/lib/ruby/gems/1.9.1/gems/win32-taskscheduler-0.2.0/lib/win32/taskscheduler.rb:880:in `new_work_item': Unknown trigger type (Win32::TaskScheduler::Error)
        from ts.rb:5:in `<main>'


I tried adding this trigger type to the switch statement in question, and then I got this error instead:

Code added:
            when TASK_EVENT_TRIGGER_AT_SYSTEMSTART
               # Do nothing. The Type member of the TASK_TRIGGER struct is ignored.

New error:
C:/Ruby19/lib/ruby/gems/1.9.1/gems/win32-taskscheduler-0.2.0/lib/win32/taskscheduler.rb:909:in `new_work_item': The system cannot find the file specified. (Win32::TaskScheduler::Error)
        from ts.rb:5:in `<main>'



Version: win32-taskscheduler 0.2.0
OS: Windows7
Ruby: ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]



----------------------------------------------------------------------

>Comment By: Daniel Berger (djberg96)
Date: 2014-01-14 19:01

Message:
Support for ON_IDLE, AT_SYSTEMSTART and AT_LOGON has been added to 0.3.0 and should be released soon. Thanks!

----------------------------------------------------------------------

Comment By: Daniel Berger (djberg96)
Date: 2011-10-26 13:54

Message:
I'm going to delay fixing this until 0.3.0 is release I'm afraid. Thanks for the report.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=411&aid=27973&group_id=85


More information about the win32utils-devel mailing list