This project has moved. For the latest updates, please go here.

Creating Daily Triggers with multiple start time using Taskservice 2.0

Oct 2, 2012 at 7:13 PM

Hi,

how can we create a daily trigger with multiple start time with taskservice.

Coordinator
Oct 3, 2012 at 12:48 AM

Use two daily triggers within the same task.

Oct 4, 2012 at 9:06 PM

In taskscheduler service (microsoft.win32.taskscheduler.dll) does not have a daily trigger constructor that accepts starttime, by default the start time gets sets to

current time.I tried creating two daily triggers with two diff time interval , but only one gets created.

Coordinator
Oct 4, 2012 at 10:41 PM

StartBoundary is a property on all triggers and can be set upon trigger creation. For example, if you wanted to create task that executes every day from this point forward at 2:00 a.m. and 2:00 p.m., you could do the following:

td.Triggers.Add(new DailyTrigger() { StartBoundary = DateTime.Today.AddHours(2) });
td.Triggers.Add(new DailyTrigger() { StartBoundary = DateTime.Today.AddHours(14) });