Run a process as admin from a system account in Windows
Posted on 2008-11-03
I'm running a process under the system account, and I want it to run another process as another user (of course, supplying the username and password).
I'm using the CreateProcessWithLogonW API function, which works fine when my process runs with any account, but NOT under system account... When running on system account, GetLastErr returns 5 (ACCESS_IS_DENIED).
I've tried altering the dwLogonFlags parameter, but in both flags (LOGON_WITH_PROFILE and LOGON_NETCREDENTIALS_ONLY) it behaves the same...