Free Code Snippets in C#, Net Framework, Office 365, ASP.Net,WPF, Visual Studio, SQL Server, Antivirus free
#

Asynchronous call with .bat files

 

Task:

How to call multiple programs in a .bat file The programs should be processed in parallel.

 

Problem:

If you want to run tasks in a batch file .bat as a batch and want to run programs in one,

then, simply entering the executable .exe file will process them sequentially, just like a stack.

All programs are executed sequentially, as in a stack, which means that each program is only started when the previous program is finished and closed.

The problem then is that the stack stops when a program is not finished and hangs in a dialog.

 

 

Synchronous Batch:

As a synchronous process:

That is, each call waits until the previous program has expired.

If there is an error or error dialog, the execute queue stops.

C:\_Daten\_Robots\1\webrobot.exe

C:\_Daten\_Robots\2\webrobot.exe

C:\_Daten\_Robots\3\webrobot.exe

C:\_Daten\_Robots\4\webrobot.exe

C:\_Daten\_Robots\5\webrobot.exe

C:\_Daten\_Robots\6\webrobot.exe

C:\_Daten\_Robots\7\webrobot.exe

C:\_Daten\_Robots\8\webrobot.exe

C:\_Daten\_Robots\9\webrobot.exe

C:\_Daten\_Robots\10\webrobot.exe

C:\_Daten\_Robots\11\webrobot.exe

 

 

Solution:

Asynchronous

With an asynchronous call, all programs are called almost simultaneously and processed in parallel

Start "1" "C:\_Daten\_Robots\1\webrobot.exe"

Start "2" "C:\_Daten\_Robots\2\webrobot.exe"

Start "3" "C:\_Daten\_Robots\3\webrobot.exe"

Start "4" "C:\_Daten\_Robots\4\webrobot.exe"

Start "5" "C:\_Daten\_Robots\5\webrobot.exe"

Start "6" "C:\_Daten\_Robots\6\webrobot.exe"

Start "7" "C:\_Daten\_Robots\7\webrobot.exe"

Start "8" "C:\_Daten\_Robots\8\webrobot.exe"

Start "9" "C:\_Daten\_Robots\9\webrobot.exe"

Start "10" "C:\_Daten\_Robots\10\webrobot.exe"

Start "11" "C:\_Daten\_Robots\11\webrobot.exe"

 

 

Mobile
»
Asynchronous call with .bat files
»
Windows 10: Change drive letter for SD card
»
Windows 10: Icons in System32 ImageRes.dll

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de