Impersonating in .NET using Process.Start and UAC

1.8k Views Asked by At

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

There are 2 best solutions below

2
On

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" />
1
On