CreateProcess to run as administrator

前端 未结 2 1822
南旧
南旧 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:03

    If you put a manifest on the child app, and if you use ShellExecute to launch, it will use the manifest and there will be a UAC prompt. (I prefer this to the "runas" approach in most cases.) This may allow you to launch the app the way you like without worrying about UAC, and get the elevating from the manifest.

    However, you may have issues if the "manage" part you refer to involves a lower privilege app communicating to an elevated one. UAC forbids that.

提交回复
热议问题