You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require 'win32/taskscheduler'
include Win32
ts = TaskScheduler.new
# 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'
ts.activate('my_notepad')
The template just create for the first Week of Month the scheduled Task but not for the last Week.
In my case i can use this template to create a Task but i need it triggered only in the last Week. If i modify the Template for my use case:
The name of the weeks of the month option was changed in chef#16 from :weeks to :weeks_of_month to mimic the Task Scheduler API, but the README was not updated to reflect this change. Fixeschef#86
Description
The template just create for the first Week of Month the scheduled Task but not for the last Week.
In my case i can use this template to create a Task but i need it triggered only in the last Week. If i modify the Template for my use case:
It didn't care and still create the Trigger in the first week!?

Gem Version
win32-taskscheduler 2.0.4
Windows Version
Microsoft Windows [Version 10.0.19044.1466]
Replication Case
Just try the given template and take a look on the Trigger under the Windows Task scheduler GUI
The text was updated successfully, but these errors were encountered: