(Win8 x64, .NET 4.0) I get the following error when I try to enable or disable a task using VB.NET:
"An unhandled exception of type 'System.Security.SecurityException' occurred in Microsoft.Win32.TaskScheduler.dll
Additional information: Tasks which have been registered previously with stored passwords must use the TaskFolder.RegisterTaskDefinition method for updates."
The code I use is very simple:
Dim t As Task = ts.GetTask(originaltask.Path)
t.Enabled = True
I don't want to prompt for user name & password for enabling/disabling tasks.
What can I do?