I just tried using SCHTASKS and the task created correctly. When i use this wrapper i noticed that the task gets created on the remote device but fails to run. If i open the task in task manager and re enter the password then the task will run.
Here is the string that works with schtasks:
SCHTASKS /Create /S 10.160.8.58 ABC /U user /P pass /RU user /RP pass /SC HOURLY /TN doc /TR notepad
and here is the c# code for the actual task creation:
Here is the string that works with schtasks:
SCHTASKS /Create /S 10.160.8.58 ABC /U user /P pass /RU user /RP pass /SC HOURLY /TN doc /TR notepad
and here is the c# code for the actual task creation:
TaskDefinition td = ts.NewTask();
td.RegistrationInfo.Description =
"Runs the deploycheck.exe";
td.Principal.LogonType = TaskLogonType.InteractiveTokenOrPassword;
td.Actions.Add(new ExecAction(program, origArguments, @"c:\temp\"));
Task task = ts.RootFolder.RegisterTaskDefinition(taskName, td,
TaskCreation.Create, "user", "pass",
TaskLogonType.Password, null);
Thanks