Call calls another batch processing program from one batch processing program without terminating the parent batch processing program.

Source: Internet
Author: User

Call
From one batch Program Call another batch processing program without terminating the parent batch processing program. The Call Command accepts the labels used as the call target. If a call is used outside a script or batch file, it does not work in the command line.

Syntax
Call [[drive:] [path] filename [batchparameters] [: Label [arguments]

Parameters
[Drive:} [path] filename
Specifies the location and name of the batch processing program to be called. The filename parameter must have the. bat or. CMD extension.
Batchparameters
Specifies any command line information required by the batch processing program, including command line options, file names, batch processing parameters (from % 0 to % 9), or variables (for example, % baud % ).
: Label
The tag to be jumped to by the batch processing program. You can use the call command with this parameter to create a new batch processing file context and give control to the statement after the specified tag. When the end of the batch processing file is first met (after the tag is jumped to), the control is returned to the statement after the call statement. The second time you encounter the end of the batch file, the batch script will be exited. For the Goto: EOF command extensions that allow you to return from the batch processing script, see "" for instructions on them.
Arguments
For a batch processing program with the label header, specify the command line information to be sent to its new instance, including command line options, file names, batch processing parameters (from % 1 to % 9) or variable (such as % baud % ).
/?
Display help at the command prompt.
Note
Use Batch Processing Parameters
Batch parameters can contain any information sent to the batch processing program, including command line options, file names, batch parameters (from % 1 to % 9), or variables (for example, % baud % ). For more information about batch parameters, see "".

Use pipelines and redirection symbols
Do not use pipelines and redirection symbols in the call command.

Send recursive call
You can create a batch program to call your own, but you must provide exit conditions. Otherwise, the parent and sub-batch processing programs can have infinite loops.

Use command Extension
If you enable command extension (by default), call accepts the label parameter as the call target. The correct syntax is as follows:

Call: Label arguments

For more information about enabling and disabling command extensions, see CMD in.

Example
To run the checknew. Bat program from another batch, type the following command in the parent batch:

Call checknew

If the parent batch processing program accepts two batch processing parameters and wants it to pass these parameters to checknew. bat, you can use the following command in the parent batch processing program:

Call checknew % 1% 2

Xox

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.