If my application requires itself to be run as an administrator, and then executes

Process.Start("notepad.exe");

Will the child process be run as administrator as well, or do I need to run it as administrator specifically?

有帮助吗?

解决方案

Yes, in most cases.

From MSDN:

Each application that requires the administrator access token must prompt the administrator for consent. The one exception is the relationship that exists between parent and child processes. Child processes inherit the user access token from the parent process.

Your child process will have the same rights as the parent. There are some exceptions. I'd suggest reading this page:

http://technet.microsoft.com/en-us/library/dd835561(v=ws.10).aspx

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top