run exe as system account

后端 未结 3 843
执念已碎
执念已碎 2021-01-14 05:05

I am trying to run my c# exe as an system account. How can I do that. I\'ve tried and

3条回答
  •  孤城傲影
    2021-01-14 05:41

    To the best of my knowledge you can not force your app to run as SYSTEM. Either your app must be a service and the service is setup to run as System or you must use a tool like PsExec to launch your executable as system.

    psexec.exe -i -s YourProgram.exe
    

    When using requestedExecutionlevel the only 3 valid options are

    • requireAdministrator - prompt for UAC always (even if the user is not an administrator).
    • asInvoker - never prompt for UAC.
    • highestAvailable - prompt for UAC if the user is a member of the Administrators group but do not prompt and run as a normal user if the user is not a member of the group.

提交回复
热议问题