Bugs: Browse | Submit New | Admin

[#27973] Cannot create a task that runs on system startup

Date:
2010-03-16 12:04
Priority:
3
Submitted By:
Innes MacKenzie (innesm)
Assigned To:
Daniel Berger (djberg96)
Category:
win32-taskscheduler
State:
Closed
Summary:
Cannot create a task that runs on system startup

Detailed description
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]

Add A Comment: Notepad

Please login


Followup

Message
Date: 2014-01-15 02:01
Sender: Daniel Berger

Support for ON_IDLE, AT_SYSTEMSTART and AT_LOGON has been added
to 0.3.0 and should be released soon. Thanks!
Date: 2011-10-26 20:54
Sender: Daniel Berger

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

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
close_date2014-01-15 02:012014-01-15 02:01djberg96
artifact_group_idNone2014-01-15 02:01djberg96
resolution_idPostponed2014-01-15 02:01djberg96
status_idOpen2014-01-15 02:01djberg96
resolution_idNone2011-10-26 20:54djberg96
assigned_tonone2011-10-26 20:54djberg96