I\'m using a thrid party Windows service that handles some automation tasks by running scripts and executables using CreateProcessAsUser(). I\'m running into problems on Win
Depending on your use case, you could do what I do. I hunt down the winlogon process for the active session and steal its token. If there's no active session (API returned -1), use 1 if WINVER >= 6 otherwise 0. This results in SYSTEM on the active session.