Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Improved task scheduler compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaczero committed Oct 14, 2019
1 parent 6522860 commit aaaa40c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion DNSChanger/DNSValidate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ public static void Enable(Interface @interface)
task.Principal.RunLevel = TaskRunLevel.Highest;
task.RegistrationInfo.Description = "Performs DNS validation procedure on boot";
task.RegistrationInfo.Author = GlobalVars.Name;
task.Triggers.Add(new BootTrigger());
task.Triggers.Add(new LogonTrigger
{
Delay = TimeSpan.FromMinutes(1),
Repetition = new RepetitionPattern(TimeSpan.FromHours(12), TimeSpan.Zero),
ExecutionTimeLimit = TimeSpan.FromMinutes(1),
UserId = null,
});
task.Actions.Add(Utilities.GetProcessPath(), $"-validate \"{@interface.Name}\" \"{AggregateDnsEntries(@interface)}\"");

ts.RootFolder.RegisterTaskDefinition(TaskPath, task);
Expand Down

0 comments on commit aaaa40c

Please sign in to comment.