CALL Help

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
alleypuppy
Posts: 82
Joined: 24 Apr 2011 19:20

CALL Help

#1 Post by alleypuppy » 07 Sep 2011 19:28

Is it possible to call one batch file from another batch file and start from a certain label within the called batch file?

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

Re: CALL Help

#2 Post by nitt » 07 Sep 2011 21:42

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

Post Reply