title: Run elevated process
body: <p>I am trying to run a cmd command with the following code:</p>
  
  <pre><code>ProcessStartInfo cmd = new ProcessStartInfo("cmd.exe");
  cmd.RedirectStandardInput = true;
  cmd.RedirectStandardOutput = true;
  cmd.RedirectStandardError = true;
  cmd.UseShellExecute = false;
  cmd.CreateNoWindow = true;
  cmd.WindowStyle = ProcessWindowStyle.Hidden;
  Process exec = Process.Start(cmd);
  exec.StandardInput.WriteLine("sc create \"BaliService\" binPath= \"{0}\\BaliService.exe\"", Directory.GetCurrentDirectory());
  </code></pre>
  
  <p>This command requires admin privelages, if I run cmd as administrator and type the command it works perfectly but not when I run this app as admin. I have added</p>
  
  <p><code>&lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false" /&gt;</code></p>
  
  <p>to a manifest file which prompts uac each time I open the exe. </p>
  
  <p>I have seen multiple questions on this and they all seem to suggest any processes run under an elevated app will have the same rights but this isn't working for me. </p>
  
  <p>I have tried <code>cmd.Verb = "runas";</code> but no dice. </p>