Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call one batch file from another and then continue batch file 1 after batch file 2 exists

I am calling batch file (say file2.bat) from another batch file (say batch file 1).

file1.bat:

echo off
@call file2.bat
@echo abc
@echo xyz
exit

I am using command exit /b to exit from file2.bat ..

For some reason, the control is not coming back to file1.bat after file2.bat exits..

What needs to be done in order to return the control back to file1.bat so that the remaining commands @echo abc @echo xyz should execute?

Thanks

like image 344
WinSupp Avatar asked Oct 20 '25 11:10

WinSupp


1 Answers

Use either cmd /c file2.bat or use goto :EOF (Where EOF means end of file), goto :eof should work in your case

like image 118
Dwad Avatar answered Oct 23 '25 05:10

Dwad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!