Run task as soon as possible after a scheduled start is missed #950
Answered
by
JosHuybrighs
hellsmenser
asked this question in
Q&A
-
How i can add param "Run task as soon as possible after a scheduled start is missed"? |
Beta Was this translation helpful? Give feedback.
Answered by
JosHuybrighs
Oct 24, 2022
Replies: 1 comment 1 reply
-
@hellsmenser // Register the executable in the TaskScheduler to run every 15 minutes.
var taskDefinition = TaskService.Instance.NewTask();
taskDefinition.RegistrationInfo.Description = "<taskDescription>";
taskDefinition.RegistrationInfo.Author = "<author>";
var trigger = new DailyTrigger { StartBoundary = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 1, 0, 0) };
trigger.Repetition.Interval = TimeSpan.FromMinutes(15);
taskDefinition.Triggers.Add(trigger);
taskDefinition.Actions.Add(new ExecAction(programDataExePathName, arguments: "<taskArgs>"));
// Set "Run task as soon as possible after a scheduled start is missed"
taskDefinition.Settings.StartWhenAvailable = true;
TaskService.Instance.RootFolder.RegisterTaskDefinition("<taskName>", taskDefinition); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dahall
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hellsmenser
Like so: