Thanks, It worked.
I have another query. In task scheduler General Tab - I want to select radio button "Run weather user is logged on or not".
I am getting error by trying following code:
CODE:
I have another query. In task scheduler General Tab - I want to select radio button "Run weather user is logged on or not".
I am getting error by trying following code:
CODE:
TaskDefinition td = ts.NewTask();
td.Settings.RunOnlyIfLoggedOn = false;
ERROR:NotV2SupportedException' was unhandled. An unhandled exception of type 'Microsoft.Win32.TaskScheduler.NotV2SupportedException' occurred in Microsoft.Win32.TaskScheduler.dll