title: Kill process tree programmatically in C#
body: <p>I am starting Internet Explorer programmatically with code that looks like this:</p>
  
  <pre><code>ProcessStartInfo startInfo = new ProcessStartInfo("iexplore.exe");
  startInfo.WindowStyle = ProcessWindowStyle.Hidden;
  startInfo.Arguments = "http://www.google.com";
  Process ieProcess = Process.Start(startInfo);
  </code></pre>
  
  <p>This generates 2 processes visible in the Windows Task Manager. Then, I attempt to kill the process with:</p>
  
  <pre><code>ieProcess.Kill();
  </code></pre>
  
  <p>This results in one of the processes in Task Manager being shut down, and the other remains. I tried checking for any properties that would have children processes, but found none. How can I kill the other process also? More generally, how do you kill all the processes associated with a process that you start with Process.Start?</p>