Skip to content

Run task as soon as possible after a scheduled start is missed #950

Answered by JosHuybrighs
hellsmenser asked this question in Q&A
Discussion options

You must be logged in to vote

@hellsmenser
Like so:

// 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.StartWhenAva…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dahall
Comment options

Answer selected by dahall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants