<p>I have some System.Diagnotics.Processes to run.  I'd like to call the close method on them automatically.  Apparently the "using" keyword does this for me.</p>

<p>Is this the way to use the using keyword?</p>

<pre><code>foreach(string command in S) // command is something like "c:\a.exe"
{
    try
    {
        using(p = Process.Start(command))
        {
            // I literally put nothing in here.
        }
    }
    catch (Exception e)
    {
        // notify of process failure
    }
}
</code></pre>

<p>I'd like to start multiple processes to run concurrently.</p>

```
```
try
{
   foreach(string command in S) // command is something like "c:\a.exe"
   {
      using(p = Process.Start(command))
      {
        // I literally put nothing in here.
      }

    } 
}
catch (Exception e)
{
    // notify of process failure
}
```
```
The reason it works is because when the exception happens, the variable p falls out of scope and thus it's Dispose method is called that closes the process is how that would go.  Additionally, I would think you'd want to spin a thread off for each command rather than wait for an executable to finish before going on to the next one.