<p>I'm trying to install a service using InstallUtil.exe but invoked through <code>Process.Start</code>. Here's the code:</p>

<pre><code>ProcessStartInfo startInfo = new ProcessStartInfo (m_strInstallUtil, strExePath);
System.Diagnostics.Process.Start (startInfo);
</code></pre>

<p>where <code>m_strInstallUtil</code> is the fully qualified path and exe to "InstallUtil.exe" and <code>strExePath</code> is the fully qualified path/name to my service.</p>

<p>Running the command line syntax from an elevated command prompt works; running from my app (using the above code) does not. I assume I'm dealing with some process elevation issue, so how would I run my process in an elevated state? Do I need to look at <code>ShellExecute</code> for this?</p>

<p>This is all on Windows Vista. I am running the process in the VS2008 debugger elevated to admin privilege.</p>

<p>I also tried setting <code>startInfo.Verb = "runas";</code> but it didn't seem to solve the problem.</p>

You should use Impersonation to elevate the state.
```
```
WindowsIdentity identity = new WindowsIdentity(accessToken);
WindowsImpersonationContext context = identity.Impersonate();
```
```
Don't forget to undo the impersonated context when you are done.