c# - Windows TaskScheduler DailyTrigger run for a duration of -


i'm creating trigger task in windows using microsoft.win32.taskscheduler.dailytrigger run daily @ 8am. task repeats every hour want stop after 10 hours until fires again next day.

in windows task scheduler application, under trigger have "repeat task every 1 hour duration of 10 hours".

the repeat task every hour can do, can't find way "for duration of". code have set trigger far, starttime datetime set 8am today.

var dailytrigger = new dailytrigger(); dailytrigger.repetition.interval = timespan.fromhours(1); dailytrigger.startboundary = starttime; dailytrigger.executiontimelimit = timespan.fromminutes(59); 

i multiple triggers, thinking if application interface allows there way in code.

edit: noticed below different class, , op downloaded a library codeplex. below still applies, it's repetition.interval , repetition.duration.

// set time in between each repetition of task after starts 30 minutes. tt.repetition.interval = timespan.fromminutes(60); // default timespan.zero (or never) // set time task repeat 1 day. tt.repetition.duration = timespan.fromdays(1); // default timespan.zero (or never) 

https://msdn.microsoft.com/en-us/library/office/microsoft.office.excel.server.addins.computecluster.taskscheduler.trigger.intervalminutes(v=office.12).aspx

intervalminutes

gets or sets number of minutes between executions task run repeatedly.

[...]

the task continues run repeatedly until interval specified in durationminutes property expires. intervalminutes value counted start of previous execution.

intervalminutes value must less durationminutes value.

https://msdn.microsoft.com/en-us/library/office/microsoft.office.excel.server.addins.computecluster.taskscheduler.trigger.durationminutes(v=office.12).aspx

durationminutes

gets or sets number of minutes trigger remains active after trigger fires.

[...]

this property used in conjunction intervalminutes property run task repeatedly period of time. example, start task @ 8:00 a.m. , repeatedly restart until 5:00 p.m., durationminutes value 540 minutes (9 hours).

the durationminutes value can used terminate running task after durationminutes property task expires.

you use killatdurationend property specify task terminated after durationminutes expires. value of durationminutes must greater or equal intervalminutes setting.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -