title: Combination of START /WAIT and /B possible?
body: <p>I'm facing a quite stupid problem. I have a list of commands generated by a NAnt script. These are stored in a bat file. In each line I'm calling an exe with several parameters. The exe operates on a set of files and modifies them. The set of files is always the same. We are talking about ~1000 calls of the exe so if each time a new console would pop up I'd get performance issues. "No problem" I thought and added <code>START /B</code> to each command line so now the exe is started in background which works way faster.
  Now here's the problem: As I've mentioned, the exe operates on the same set of files so sometimes it happens that a file can't be modified because it's already opened by a different instance of the program which results in a crash. I'd like to add the <code>/W</code> parameter to each call to ensure that never two instances run at the same time. But this somehow disables the <code>/B</code> parameter.</p>
  
  <p>So my question is: is it possible to have my exe started in background AND force my batch to wait for each instance to terminate?</p>
  
  <p><strong>Please don't tell me that this is ugly. I know but I can't change anything about the setup. My company has been working with this s*** for years and the only point where I can make modifications is the generated bat file.</strong></p>
  
  <p>Here is the code of the generated bat:</p>
  
  <pre><code>start /B /W S:\ome\path\to\my\exe.exe --param1 --param2 "XYZ" --param3 "ZYX" --param4 "1 2 3" --param5 "321" --param6 "1337" --param7
  start /B /W S:\ome\path\to\my\exe.exe --param1 --param2 "XYZ" --param3 "ZYX" --param4 "1 2 3" --param5 "321" --param6 "1337" --param7
  start /B /W S:\ome\path\to\my\exe.exe --param1 --param2 "XYZ" --param3 "ZYX" --param4 "1 2 3" --param5 "321" --param6 "1337" --param7
  ...
  start /B /W S:\ome\path\to\my\exe.exe --param1 --param2 "XYZ" --param3 "ZYX" --param4 "1 2 3" --param5 "321" --param6 "1337" --param7
  start /B /W S:\ome\path\to\my\exe.exe --param1 --param2 "XYZ" --param3 "ZYX" --param4 "1 2 3" --param5 "321" --param6 "1337" --param7
  start /B /W S:\ome\path\to\my\exe.exe --param1 --param2 "XYZ" --param3 "ZYX" --param4 "1 2 3" --param5 "321" --param6 "1337" --param7
  </code></pre>