Closed ghost closed 1 year ago
Both the UI and my library use the COM interfaces exposed by Windows. What you're experiencing is a nuance of that base library. It requires you to specify the LogonType
during registration and will not pick it up from the XML. Use the extended parameters in the RegisterTask
method to specify all account related information. E.g.
TaskService.Instance.RootFolder.RegisterTask("Example", File.ReadAllText("Example.xml"),
TaskCreation.CreateOrUpdate, null, null, TaskLogonType.InteractiveToken, null);
TaskScheduler (2.10.1), installed via NuGet Visual Studio 2022 17.4.0 Community Windows 10 22H2 19045.2006
I'm trying to create a new task from a XML file with this code:
The XML is this:
Unfortunately, the
LogonType
will not be applied. But if I import this XML file from the%windir%\system32\taskschd.msc
GUI, it will be.Is this a bug of your project or a problem of the Windows API / Windows Task Scheduler?