holemania
asked on
Dos command to wait for another bat file to complete before continuing
Hello experts,
I have 2 batch file. One fire first and then call another batch file to run. How would I set it so that it would wait until that 2nd batch file finish before continuing?
Batch File 1:
@echo off
Start G:\MappedDrv.bat
Start G:\Autocad.exe
Exit
Batch File 2:
@echo off
net use g: /delete
net use g: \\server1\data\eng
exit
Not that batch 2 does some processing after mapping the drive by copying some user setting files over so can take a while. Issue that I am running into is that there are open files. So is there a way to set it so that first bat file will call the 2nd one to complete running and then continue on?
I have 2 batch file. One fire first and then call another batch file to run. How would I set it so that it would wait until that 2nd batch file finish before continuing?
Batch File 1:
@echo off
Start G:\MappedDrv.bat
Start G:\Autocad.exe
Exit
Batch File 2:
@echo off
net use g: /delete
net use g: \\server1\data\eng
exit
Not that batch 2 does some processing after mapping the drive by copying some user setting files over so can take a while. Issue that I am running into is that there are open files. So is there a way to set it so that first bat file will call the 2nd one to complete running and then continue on?
Use the start command. When invoked, it will wait untill the called batch is finished.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.