(C#) How do you de-elevate permissions for a child process

Posted by Davy8 on Stack Overflow See other posts from Stack Overflow or by Davy8
Published on 2009-07-23T18:29:06Z Indexed on 2010/05/07 0:08 UTC
Read the original article Hit count: 172

Filed under:
|
|
|

I know how to launch a process with Admin privileges from a process using:

proc.StartInfo.UseShellExecute = true;
proc.StartInfo.Verb = "runas";

where proc is a System.Diagnostics.Process. But how does one do the opposite?

If the process you're in is already elevated, how do you launch the new process without admin privileges? More accurately, we need to launch the new process with the same permission level as Windows Explorer, so no change if UAC is diabled, but if UAC is enabled, but our process is running elevated, we need to perform a certain operation un-elevated because we're creating a virtual drive and if it's created with elevated permissions and Windows explorer is running unelevated it won't show up.

Feel free to change the title to something better, I couldn't come up with a good description

© Stack Overflow or respective owner

Related posts about c#3.0

Related posts about process