CALL - Execute one batch file from another
Purpose: Execute one batch file from within another.
Format: CALL [/Q] file
file : The batch file to execute.
/Q(uiet)
See also: CANCEL and QUIT.
Usage
CALL allows batch files to call other batch files (batch file nesting).
The calling batch file is suspended while the called (second) batch file
runs. When the second batch file finishes, the original batch file
resumes execution at the next command. If you execute a batch file from
inside another batch file without using CALL, the first batch file is
terminated before the second one starts.
The following batch file fragment compares an input line to "wp" and
calls another batch file if it matches:
input Enter your choice: %%option
if "%option" == "wp" call wp.bat
CMD.EXE supports batch file nesting up to ten levels deep.
The current ECHO state is inherited by a called batch file, except when
the /Q.
The called batch file should always either return (by executing its last
line, or using the QUIT command), or terminate batch file processing with
CANCEL. Do not restart or CALL the original batch file from within the
called file as this may cause an infinite loop or a stack overflow.
CALL returns an exit code which matches the batch file return code. You
can test this exit code with the %_? or %? environment variable, and use
it with conditional commands.
Options
/Q: (Quiet) Starts the new batch file with echo off, regardless of
the current batch file's echo state. This switch is provided
for compatibility with OS/2's CMD.EXE.
Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs