It depends on how .exe works. Iβm afraid that I donβt have all the technical details or terminology, but some .exe files will return session control right after they start, while others will not return control until the program terminates.
The second case is simple, because the commands at the end of the file will not be executed until the first ones are completed, so I assume that you are faced with case No. 1.
An easy workaround / hack, if the execution takes about the same amount of time each time you start it, use the ping command with a delay.
PING 127.0.0.1 -n 1 -w 120000 >NUL
This will cause the ping command to run once with a delay of 120,000 ms (2 min).
There is also a good article on a more complex (but more reliable method) on fpschultze.de with a much more detailed explanation. In short, you are requesting a list of tasks that are looking for the executable that you expect. Once this is not the case, you continue with the batch file. He also uses the ping method, but in a different way.
kdmurray
source share