[Win32utils-devel] [ win32utils-Feature Requests-26603 ] TaskScheduler creates .job file on 2k3 but does not register job with the scheduler

noreply at rubyforge.org noreply at rubyforge.org
Tue Jan 14 21:16:33 UTC 2014


Feature Requests item #26603, was opened at 2009-07-13 14:19
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=414&aid=26603&group_id=85

>Category: win32-taskscheduler
>Group: Code
Status: Open
Resolution: Accepted
Priority: 3
Submitted By: Erik Hollensbe (erikh)
>Assigned to: Daniel Berger (djberg96)
Summary: TaskScheduler creates .job file on 2k3 but does not register job with the scheduler

Initial Comment:
Using this code:

require 'rubygems'
require 'win32/taskscheduler'

t = Win32::TaskScheduler.new("task", {
   "start_month"  => 4,
   "start_day"    => 11,
   "start_hour"   => 7,
   "start_minute"	 => 14,
   "trigger_type"	 => Win32::TaskScheduler::DAILY,
   "type"         => { "days_interval" => 2 }
})

t.application_name = "ruby test.rb"
t.save

Which is taken almost verbatim out of:

http://jp.rubyist.net/magazine/?0005-RLR-en

It saves C:\Windows\Tasks\task.job but upon viewing the scheduled tasks list, it does not appear.

I'm not really a windows maven, but here's what I know about the environment:

Windows 2003 Server R2
Ruby mingw32 build of 1.8.6 pl 114 (2008-03-03)

gem list --local reports these gems in use:

win32-api 1.4.3
windows-api 0.3.0
windows-pr 1.0.5
win32-taskscheduler 0.2.0

HTH, Let me know if you require any more information.

Thanks as always,

-Erik

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

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

Message:
Upon further review, I think the start day, month and year must all be set.

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

Comment By: Daniel Berger (djberg96)
Date: 2010-02-20 10:43

Message:
Is start_year the only required field? My memory is failing.

Regards,

Dan

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

Comment By: Daniel Berger (djberg96)
Date: 2009-09-25 09:16

Message:
Bumping to a feature request.

- Dan

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

Comment By: Daniel Berger (djberg96)
Date: 2009-07-14 08:31

Message:
We'll add required fields to the next release Erik. Thanks for the report.

Regards,

Dan

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

Comment By: Erik Hollensbe (erikh)
Date: 2009-07-14 06:47

Message:
I'll give this a shot, but if I can be granted license to
complain a little, the distinct lack of required fields
checking and documentation has made this library very hard
to work with. If I knew more of what I was doing on windows
I'd gladly contribute patches but I don't think that would
serve you well with my current level of knowledge.

Is there any chance that this lack of information can be
remedied in the next release?

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

Comment By: Park Heesob  (phasis68)
Date: 2009-07-14 06:40

Message:
It's not a bug. 
You have ommitted required field 'start_year'. 
The code should be like this:
t = Win32::TaskScheduler.new("task", {
   "start_year"  => 2010,
   "start_month"  => 4,
   "start_day"    => 11,
   "start_hour"   => 7,
   "start_minute"	 => 14,
   "trigger_type"	 => Win32::TaskScheduler::DAILY,
   "type"         => { "days_interval" => 2 }
})

Of course, the missing field checking routine might be helpful.

Regards,

Park Heesob


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

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


More information about the win32utils-devel mailing list