win32 taskscheduler setup

R

rtilley

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!
 
R

rtilley

rtilley said:
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!
 
P

Park Heesob

Hi,
From: rtilley <[email protected]>
Reply-To: (e-mail address removed)
To: (e-mail address removed) (ruby-talk ML)
Subject: win32 taskscheduler setup
Date: Tue, 28 Mar 2006 10:43:55 +0900

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!

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 Heesob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top