I run dostest.bat & within that batch file i call dostest2.bat
In the second batch file it has the exit command. What commands do i use to return the second batch file to the 1st to complete.
Thanks in advance.
Return to original bat file
Moderator: DosItHelp
Re: Return to original bat file
Batch execution ends if the end of the batch code was reached. Thus, in most cases you don't need to quit it with an additional command. You may use EXIT /B or GOTO :EOF if you want to exit from somewhere whithin your code.
Steffen
Steffen
Re: Return to original bat file
To be able to return to the 1st batch after finishing the 2nd batch, you need to use the "call" command.
Batch1.bat:
Batch1.bat:
Code: Select all
...
call batch2.bat
rem continue with the rest of batch1 file.
...
Re: Return to original bat file
Also ensure you use exit /b in your exit protocols of your child script to return to parent process.
Using exit without /b will terminate entire CMD process....
Using exit without /b will terminate entire CMD process....
Re: Return to original bat file
Thanks all for the help and codes. Works great.