title: Get the PID of a Windows service
body: <p>Could anyone help me to know how to get the PID of a Windows service?<br>
  I need to get the PID in order to run the following command: </p>
  
  <pre><code>Process.Start(new ProcessStartInfo 
      {
          Filename = "cmd.exe",
          CreateNoWindow = true,
          UseShellExecute = false,
          Arguments = string.Format("/c taskkill /pid {0} /f", pidnumber)
      });
  </code></pre>