Non-blocking batch file execution

I have the following commands in a batch file:

"C:\MI2\Stream\bin\Debug\Stream.exe" 19 "C:\MI2\Stream\bin\Debug\Stream.exe" 20 "C:\MI2\Stream\bin\Debug\Stream.exe" 21 "C:\MI2\Stream\bin\Debug\Stream.exe" 23 "C:\MI2\Stream\bin\Debug\Stream.exe" 25 

I am trying to execute 5 instances of the application I created, passing them to another parameter. My goal is that when I run this batch file, it launches 5 instances of this application, loading the user interface component for each. In the end, I will make it more elegant and put a wrapper around it, but for now I just want them to run at the same time.

The problem is that when I run this batch file, it executes the first line, loading the user interface. It. It does not go to the second line. Thoughts?

Edit to add - I could do this from separate batch files, but I would like to launch one click. Scott

+4
source share
3 answers

You can use start :

 start "" "C:\MI2\Stream\bin\Debug\Stream.exe" 19 start "" "C:\MI2\Stream\bin\Debug\Stream.exe" 20 start "" "C:\MI2\Stream\bin\Debug\Stream.exe" 21 start "" "C:\MI2\Stream\bin\Debug\Stream.exe" 23 start "" "C:\MI2\Stream\bin\Debug\Stream.exe" 25 

The first argument is the name of the created command-line window, which we are not interested in, so you can leave it blank.

It would be even better to use for :

 forr %i in (19, 20, 21, 23, 25) do start "" "C:\MI2\Stream\bin\Debug\Stream.exe" %i 
+15
source

Do

 start C:\MI2\Stream\bin\Debug\Stream.exe 19 start C:\MI2\Stream\bin\Debug\Stream.exe 20 

and etc.

+2
source

Use start:

 start C:\MI2\Stream\bin\Debug\Stream.exe 19 start C:\MI2\Stream\bin\Debug\Stream.exe 20 start C:\MI2\Stream\bin\Debug\Stream.exe 21 start C:\MI2\Stream\bin\Debug\Stream.exe 23 start C:\MI2\Stream\bin\Debug\Stream.exe 25 
+2
source

All Articles