title: programmatically run cmd.exe as administrator in vista, C#
body: <p>I have a visual studio setup and deployment project. I've added a .cmd script in it. The script would need administrator privileges to run. When user clicks on the setup.exe, UAC prompts the user for Admin permissions. So I assumed that all processes created and called within setup.exe will run in admin capacity. So I made the setup call my console application which contains the following code.</p>
  
  <pre><code>ProcessStartInfo p1 = new ProcessStartInfo();
  p1.UseShellExecute = true;
  p1.Verb = "runas";
  p1.FileName = "cmd.exe";
  Process.Start(p1);
  </code></pre>
  
  <p>So it should've worked as it's run under administrator space.</p>
  
  <p>I want to run cmd.exe through c# process class as an administrator.I'm running windows vista.</p>
  
  <p>I tried
  didn't work! What can I do?</p>