Consider two bat files.
outer.bat
echo Before
inner.bat
echo After
inner.bat
echo Inner
goto :eof
When I execute outer.bat “After” is not echoed. So “goto :eof” in the inner script terminates the outer script.
Can I rewrite outer.bat to continue execution after calling inner.bat without modifying inner.bat?
Batch files have a single execution context. When you nest batchfile calls like that, the nested file completely replaces the outer/parent batch file’s context. There’s no record saying that there was a parent batch file, so you simply return to the prompt when the inner file completes.
To be able to return to the outer batch file, you have to do