title: Start and stop a service using c#
body: <p>I would like to stop a service and then restart the service once it has finished stopping.
  I am using c# and have produced the following code. The problem is: if the service is started it will stop the service but not restart the service. If the service is stopped the next time the function is called it will just start the service.</p>
  
  <pre><code>string strCmdText1, strCmdText2;
  strCmdText1 = "NET STOP \"AdmnService\"";
  strCmdText2 = "NET START \"AdmnService\"";
  System.Diagnostics.Process.Start("CMD.exe", "/C" + strCmdText1);
  System.Diagnostics.Process.Start("CMD.exe", "/C" + strCmdText2);
  </code></pre>
  
  <p>Is there a way to concatenate the commands into one line? I am not sure what the /C does but perhaps there is some other switch to execute two commands.</p>