Вопрос

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