CreateProcess to run as administrator

前端 未结 2 1876
南旧
南旧 2021-01-15 13:05

In my Win32 application I have the ability to run child processes with redirected input and output to anonymous pipes that I create and manage - this all works with the Crea

2条回答
  •  情歌与酒
    2021-01-15 14:05

    It should be possible to set the environment variable __COMPAT_LAYER to RunAsAdmin before the CreateProcess call which tells windows to just force the run as admin via the compatibility flags. The environment variable can be deleted once the process is started.

提交回复
热议问题