title: Execute net user command from C#
body: <p>I want to execute net user command from C#.</p>
  
  <p>Below is my code:-</p>
  
  <pre><code>         ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd.exe");
           procStartInfo.UseShellExecute = true;
           procStartInfo.CreateNoWindow = true;
           procStartInfo.Verb = "runas";
           procStartInfo.Arguments = "/env /user:" + "Administrator" +  "cmd /K \"net user ABC Admin123# /add\\\"";
  
           ///command contains the command to be executed in cmd
           System.Diagnostics.Process proc = new System.Diagnostics.Process();
           proc.StartInfo = procStartInfo;
           proc.Start();
  </code></pre>
  
  <p>When i run the program the command prompt window open in administrative mode and show the folowing result:-</p>
  
  <p>The syntax of this command is:</p>
  
  <pre><code>NET USER
  [username [password | *] [options]] [/DOMAIN]
           username {password | *} /ADD [options] [/DOMAIN]
           username [/DELETE] [/DOMAIN]
           username [/TIMES:{times | ALL}]
  
  
  C:\Windows\system32&gt;
  </code></pre>
  
  <p>When i run simple commands like cd/ , dir  e.tc. it runs fine.</p>