Page 1 of 1

CALL Help

Posted: 07 Sep 2011 19:28
by alleypuppy
Is it possible to call one batch file from another batch file and start from a certain label within the called batch file?

Re: CALL Help

Posted: 07 Sep 2011 21:42
by nitt
alleypuppy wrote:Is it possible to call one batch file from another batch file and start from a certain label within the called batch file?


test.bat

Code: Select all

@echo off
set label=label2
call test2.bat
set label=label1
call test2.bat
pause


test2.bat

Code: Select all

goto %label%

:label1
echo label 1
goto eof

:label2
echo label 2
goto eof

:eof