Forum: Ruby win32 taskscheduler setup

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
rtilley (Guest)
on 2006-03-28 05:44
(Received via mailing list)
Is there a way to specify multiple schedules when setting up a task?

I'd like to do something such as this:

"trigger_type"	=> TaskScheduler::ON_IDLE & AT_LOGON

Also, I just heard that a Ruby Win32 is underway. That's going to be
very nice. Looking forward to buying a copy!
Park H. (Guest)
on 2006-03-28 07:04
(Received via mailing list)
Hi,

>"trigger_type"	=> TaskScheduler::ON_IDLE & AT_LOGON
>
>Also, I just heard that a Ruby Win32 is underway. That's going to be very
>nice. Looking forward to buying a copy!
>

You can add multiple triggers like this:

trigger1 = {
	"start_year" 	=> 1,
	"start_month" 	=> 1,
	"start_day"   	=> 1,
	"trigger_type"	=> TaskScheduler::ON_IDLE
}
trigger2 = {
	"start_year" 	=> 1,
	"start_month" 	=> 1,
	"start_day"   	=> 1,
	"trigger_type"	=> TaskScheduler::AT_LOGON
}

ts = TaskScheduler.new
ts.new_work_item("foo",nil)
ts.application_name = "notepad.exe"
ts.trigger=trigger1
ts.trigger=trigger2
ts.save

A little weird, but it works for the current version.

Regards,

Park H.
Brad T. (Guest)
on 2006-08-03 16:21
(Received via mailing list)
rtilley wrote:
> Also, I just heard that a Ruby Win32 is underway. That's going to be
> very nice. Looking forward to buying a copy!

Ruby Win32 _book_ that is!
This topic is locked and can not be replied to.