More ways to use DOS call and start

Source: Internet
Author: User

Then, when the B.bat is executed, the Hello is assigned to% 1, while the% 0 represents A.bat.

(in batches, you can use%* to represent all the parameters%1-%9 represent 9 parameters, and% 0 for the batch itself, its extended usage is shown in call/?)

Here's how to use goto:eof, such as:

A.bat content:

@echo off

Echo%0%1

Goto:eof

B.bat content:

@echo off

Call A.bat Hello

Dir c \

Pause

Here, after the display of Hello, dir c: \ is executed and paused, and if goto:eof is changed to exit, it will automatically exit when the Hello is displayed. Because the goto:eof will go to the end of A.bat, that is, only exit A.bat and then continue to execute dir; because call A.bat, in the execution of A.bat and B.bat is a cmd window, exit will be directly exited this window, this is goto: The EOF and exit differences.

More ways to use DOS call and start

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.