TaskDefinition td = ts.NewTask();// Set the TimeSpan to a value that gives the action long enough to complete td.Settings.DeleteExpiredTaskAfter = TimeSpan.FromMinutes(1); td.Triggers.Add(new TimeTrigger());// Set the action to what needs to execute td.Actions.Add(new ExecAction("notepad.exe", "c:\\test.log", null)); ts.RootFolder.RegisterTaskDefinition("TaskName", td);
↧
New Post: How to auto-delete a task after running once?
↧