Batch file calls second, goto :EOF ends both?

August 25, 2009 at 05:51:34
Specs: Windows XP
I have one batch file calling a second. In the
second file there is a FOR loop. I exit the
FOR loop with a goto :EOF command but this
seems to end both batch files. How can I end
only the second batch file (the one with the for
loop in it)?

Thanks.


See More: Batch file calls second, goto :EOF ends both?

Report •


#1
August 25, 2009 at 07:55:08

How do you call your second batch file ?

if you just use:
b.bat
it will go wrong
you should use:
call b.bat

Hopes this helps


Report •

#2
August 25, 2009 at 07:55:14
Could it be that you forgot to use the CALL command in the first batch file? If you just "run" the second batch file from the first, you transfer control to the second batch file (like a goto) rather than calling it.

Report •

#3
August 25, 2009 at 07:57:07
Piet got there first with the same advice... just beat me by 6 seconds!

Report •

Related Solutions

#4
August 25, 2009 at 08:01:06
sorry :-)

Report •


Ask Question