How to register a schedule task so that the task executes for the existing user

114 Views Asked by At

I am scheduling a particular task. The task is working fine for the admin account but when I switch to the guest account nothing happens. This is part of the code which registers the task.

IRegisteredTask *pRegisteredTask = NULL;
    hr = pRootFolder->RegisterTaskDefinition(
            _bstr_t( wszTaskName ),
            pTask,
            TASK_CREATE_OR_UPDATE, 
            _variant_t(L""),
            variant_t(),
            TASK_LOGON_INTERACTIVE_TOKEN,
            variant_t(L""),
            &pRegisteredTask);

So, how to modify it so that the task also runs for non-admin accounts.

0

There are 0 best solutions below