# Win32 taskscheduler setup

**URL:** <https://www.ruby-forum.com/t/win32-taskscheduler-setup/56091>\
**Category:** Ruby\
**Created:** [March 28, 2006, 3:44am UTC](https://www.ruby-forum.com/t/win32-taskscheduler-setup/56091 "2006-03-28T03:44:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rtilley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce7236/32.png) [@rtilley](https://www.ruby-forum.com/u/rtilley)\
**Post date:** [March 28, 2006, 3:44am UTC](https://www.ruby-forum.com/t/win32-taskscheduler-setup/56091/1 "2006-03-28T03:44:25Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![rtilley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce7236/32.png) [@rtilley](https://www.ruby-forum.com/u/rtilley)\
**Post date:** [March 28, 2006, 5:04am UTC](https://www.ruby-forum.com/t/win32-taskscheduler-setup/56091/2 "2006-03-28T05:04:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rtilley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce7236/32.png) [@rtilley](https://www.ruby-forum.com/u/rtilley)\
**Post date:** [August 3, 2006, 2:21pm UTC](https://www.ruby-forum.com/t/win32-taskscheduler-setup/56091/3 "2006-08-03T14:21:58Z")

</div>

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!
