Glad you figured it out. Just some thoughts on code optimizations:
// If just creating a default TaskService (new TaskService()), use TaskService.Instance instead. You can then avoid the 'using' clause. TaskService ts = TaskService.Instance; // Use this statement to get a folder that may have not been created. TaskFolder tf = ts.RootFolder.GetFolder(folderName) ?? ts.RootFolder.CreateFolder(folderName); // All triggers set StartBoundary to DateTime.Now in the constructor so you could write: td.Triggers.Add(new DailyTrigger { Enabled = false }); // You don't need to explicitly add ExecAction. Instead you can write: td.Actions.Add(targetPathDir + "\\LunaSleep.exe");