Sunday, June 10, 2018

Fire batch (.bat) file execution and continue


I want to write a .bat file that starts executing another few .bat files, without waiting for the 1st to complete before going to the next one. Spawning multiple cmd.exe commands is OK.


I tried doing


call script1.bat
call script2.bat

from the "main" batch file, but this runs synchronously.


Answer



I found a way of accomplishing this by using start instead of call:


start script1.bat
start script2.bat

This works pretty much like double-clicking the script files, only from the command-line :-)


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...