Nov 24, 2008 at 1:05 PM
Edited Nov 25, 2008 at 2:10 PM
Thanks for reply. I will use this feature.
I have some questions about specific flags returned by v1 ITask::GetFlags() method.
This flag seems to be missing in your class. Maybe it is possible to combine it with TaskSettings.DeleteExpiredTaskAfter.
The description of this flag in MSDN says "The work item causes the system to be resumed, or awakened, if the system is running on battery power. This flag is supported only on systems that support resume timers."
You implemented it as TaskPrincipal.LogonType. Is it correct? I think that it should be returned by
public TaskLogonType LogonType
if (v2Principal != null)
if ((v1Task.GetFlags() & V1Interop.TaskFlags.Interactive) == V1Interop.TaskFlags.Interactive)
else if ((v1Task.GetFlags() & V1Interop.TaskFlags.SystemRequired) == V1Interop.TaskFlags.SystemRequired)
throw new NotV1SupportedException();
There are no such property in the TaskSettings class.
According to MSDN TASK_LOGON_INTERACTIVE_TOKEN_OR_PASSWORD (IPrincipal::LogonType) and TASK_FLAG_INTERACTIVE (ITask::GetFlags) are different but Task Scheduler Wrapper thinks that they are the same (see source code fragment above).