The win32-taskscheduler library is a Ruby interface to the MS Windows Task
Scheduler. It is analogous to the Unix cron daemon.


* win32-api
* windows-pr


gem install win32-taskscheduler


require 'win32/taskscheduler'
include Win32
ts =
# Create a trigger that starts on April 25, 2014 at 11:05 pm. The trigger
# will run on the first and last week of the month, on Monday and Friday,
# in the months of April and May.
trigger = {
  :start_year   => 2014,
  :start_month  => 4,
  :start_day    => 25,
  :start_hour   => 23,
  :start_minute => 5,
  :trigger_type => TaskScheduler::MONTHLYDOW,
  :type => {
    :weeks        => TaskScheduler::FIRST_WEEK | TaskScheduler::LAST_WEEK,
    :days_of_week => TaskScheduler::MONDAY | TaskScheduler::FRIDAY,
    :months       => TaskScheduler::APRIL | TaskScheduler::MAY
ts.new_work_item('my_notepad', trigger)
ts.application_name = 'notepad.exe'


If you installed this library as a gem then the documentation was built for
you and can be viewed if your gem server is running. There is also some
documentation on the github wiki page.
Otherwise, you can look at the doc/taskscheduler.txt file which should have
everything you need.


This library was modeled to some degree on the Win32::TaskScheduler Perl
module by Umberto Nicoletti. However, there are some differences. Please see
the documentation for details.

Using OLE

There's an OLE version in the works. Please see the 'ole' branch on github.


This package is provided "as is" and without any express or
implied warranties, including, without limitation, the implied
warranties of merchantability and fitness for a particular purpose.

Known Issues

None known.
Please submit any bug reports to the project page at


(C) 2003-2011 Daniel J. Berger
All Rights Reserved


Artistic 2.0


Park Heesob
Daniel Berger