On Windows Vista, I can't register a task when a password is required. I'm using the version 2.5.27 of the wrapper.
The next code works on other operative systems, but not in Windows Vista:
TaskDefinition td = taskScheduler.NewTask();
td.Actions.Add(Application.ExecutablePath, string.Format("\"{0}\"", configPath));
td.Settings.DisallowStartIfOnBatteries = false;
td.Settings.StopIfGoingOnBatteries = false;
Task task = taskScheduler.RootFolder.RegisterTaskDefinition(taskName, td);
task.Definition.Principal.LogonType = TaskLogonType.Password;
task.Definition.Principal.RunLevel = TaskRunLevel.Highest;
TaskEditDialog editorForm = new TaskEditDialog(task, true, true);
editorForm.ShowDialog();
When clicking on OK button of the Task Edit Dialog, we are prompted to type password of the account. Even if the password is right, we get the error of the screenshot.
Comments: ** Comment from web user: mpthegr **
The next code works on other operative systems, but not in Windows Vista:
TaskDefinition td = taskScheduler.NewTask();
td.Actions.Add(Application.ExecutablePath, string.Format("\"{0}\"", configPath));
td.Settings.DisallowStartIfOnBatteries = false;
td.Settings.StopIfGoingOnBatteries = false;
Task task = taskScheduler.RootFolder.RegisterTaskDefinition(taskName, td);
task.Definition.Principal.LogonType = TaskLogonType.Password;
task.Definition.Principal.RunLevel = TaskRunLevel.Highest;
TaskEditDialog editorForm = new TaskEditDialog(task, true, true);
editorForm.ShowDialog();
When clicking on OK button of the Task Edit Dialog, we are prompted to type password of the account. Even if the password is right, we get the error of the screenshot.
Comments: ** Comment from web user: mpthegr **
I still see the error.
I cannot tell customers to use the tool and resolve the problem.
Other windows applications(running under the same user) are able to create tasks in taskscheduler.
can you suggest some-other solution.