title: Launch processes one after another in C#
body: <p>Is there a way to iterate through an array/list and launch a process, and wait until it's exited until launching the next, and so on?</p>
  
  <p>I have the code:</p>
  
  <pre><code>string[] processPaths = new string[]{ @"c:\foo.exe", @"c:\bar.exe" };
  foreach(string s in processPaths){
      Process p = new Process();
      p.Exited += (obj, ev) =&gt; { continue; };
  }
  </code></pre>
  
  <p>but obviously processes are executed asynchronously and the lambda function isn't part of the <code>foreach</code> loop. It's a console application, and I don't mind if it runs on the main thread.</p>