I am using Microsoft.Win32.TaskScheduler.dll in an appliction to create and change a task. If I set the property Task.Enabled to False it will not be saved to Windows. All other information is saved properly.
Code:
Dim Task1 As Task = CurrentTaskService.RootFolder.RegisterTaskDefinition(PathOfTask, TaskDefinition1)
Task1.Enabled = False
Task1.RegisterChanges()
This was working properly in build 2.0.3, but does not work in build 2.2.0.
Comments: ** Comment from web user: dahall **
Code:
Dim Task1 As Task = CurrentTaskService.RootFolder.RegisterTaskDefinition(PathOfTask, TaskDefinition1)
Task1.Enabled = False
Task1.RegisterChanges()
This was working properly in build 2.0.3, but does not work in build 2.2.0.
Comments: ** Comment from web user: dahall **
Your code did not come through. I have done testing now on XP, Vista, Win7 and Win8 using a simple task registered similar to the one in your original message. I cannot get it to fail. How are you confirming that the task has not been disabled? Both the code (Task.Enabled) as well as the Windows Task Scheduler app show the tasks as disabled. I have noticed that the TaskDefinition.Settings.Enabled property does not get updated immediately, but other, more typical, queries are.