call
Updated: January 21, 2005
Call
Syntax
Parameters
Remarks
- Using batch parameters
Batch parameters can contain any information that you can pass to a batch program, including command-line options, file names, batch parameters (that is, %0 through %9), and variables (for example, %baud%). For more information about batch parameters, see Related Topics.
- Using pipes and redirection symbols
Do not use pipes and redirection symbols with call.
- Making a recursive call
You can create a batch program that calls itself, however, you must provide an exit condition. Otherwise, the parent and child batch programs can loop endlessly.
- Working with command extensions
With command extensions enabled (that is, the default), call accepts a Label as the target of the call. The correct syntax is as follows:
call:Label Arguments
For more information about enabling and disabling command extensions, see cmd in Related Topics.
Examples
call checknew
If the parent batch program accepts two batch parameters and you want it to pass those parameters to Checknew.bat, use the following command in the parent batch program:
call checknew %1 %2
Formatting legend
Format | Meaning |
Italic | Information that the user must supply |
Bold | Elements that the user must type exactly as shown |
Ellipsis (...) | Parameter that can be repeated several times in a command line |
Between brackets ([]) | Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one |
Courier font | Code or program output |