Feature Requests: Browse | Submit New | Admin

[#26603] TaskScheduler creates .job file on 2k3 but does not register job with the scheduler

2009-07-13 21:19
Submitted By:
Erik Hollensbe (erikh)
Assigned To:
Daniel Berger (djberg96)
TaskScheduler creates .job file on 2k3 but does not register job with the scheduler

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

Which is taken almost verbatim out of:


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,


Add A Comment: Notepad

Please login


Date: 2014-01-14 21:39
Sender: Daniel Berger

Ok, I've added some validation for the next release. Closing.
Date: 2014-01-14 21:16
Sender: Daniel Berger

Upon further review, I think the start day, month and year must
all be set.
Date: 2010-02-20 17:43
Sender: Daniel Berger

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


Date: 2009-09-25 16:16
Sender: Daniel Berger

Bumping to a feature request.

- Dan
Date: 2009-07-14 15:31
Sender: Daniel Berger

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


Date: 2009-07-14 13:47
Sender: Erik Hollensbe

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?
Date: 2009-07-14 13:40
Sender: Park Heesob 

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.


Park Heesob

Attached Files:

Name Description Download
No Files Currently Attached


Field Old Value Date By
close_date2014-01-14 21:392014-01-14 21:39djberg96
status_idOpen2014-01-14 21:39djberg96
assigned_tonone2014-01-14 21:16djberg96
artifact_group_idNone2014-01-14 21:16djberg96
category_idNone2014-01-14 21:16djberg96
resolution_idNone2009-09-25 16:16djberg96
category_idwin32-taskscheduler2009-09-25 16:16djberg96