views:

48

answers:

2

I am trying to run programs from another .NET program that requires elevation using the impersonation option of the Process.Start (System.Diagnostics) method. The user for impersonation is a local administrator. The O/S is 2008 and UAC is turned on. Whenever calling process start I'm getting a Win32 permission error:

"The requested operation requires elevation"

+2  A: 

If the .NET application you are calling is configured properly in the app.manifest, you don't have to specify anything in the Process.Start call - the UAC will appear automatically.

app.manifest setting:

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
testalino
make sure `UseShellExecute` is true.
Kate Gregory
The default value for UseShellExecute is actually true. But good point anyway.
testalino
A: 

Some information you might find helpful:

http://www.codeproject.com/KB/cs/zetaimpersonator.aspx

http://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity.impersonate%28VS.71%29.aspx

code4life
Unfortunately both links were not helpful. From what I've read so far it seems that as part of the UAC it is not possible to open a process with impersonation and also run it elevated at the same time.
Dani

related questions