Common batch file commands and their usage (2)

Source: Internet
Author: User

EchoDisplay the following content on the command line interface
Echo offAfter this statement, all running commands do not display the command line itself.
@ CommandThe command line itself is not displayed during running.

1) the content of test. bat is as follows:
Echo haha
Execution result> Test
> Echo haha
Haha
2) The content of test. bat is as follows:
@ Echo haha
Execution result> Test
Haha
3) The content of test. bat is as follows:
Echo off
Echo haha
Execution result> Test
> Echo off
Haha

TIPS: How can we achieve this in order not to display all commands? Add@ Echo offAll solved.

CallCall another batch file (if another batch file is called directly, the file cannot be executed after it is executed
Subsequent commands of the preceding files)

PauseThis statement will be paused, and press any key to continue...

RemIt indicates that the character after this command is interpreted as a line. If it is not executed, it is only used for future search.
1) the content of test. bat is as follows:
@ REM echo haha
Execution result> Test
No output
2) The content of test. bat is as follows:
@ Rem
Echo haha
Execution result> Test
> Echo haha
Haha
It can be seen that REM is only effective for this row.

%A parameter is a string that is added after the file name when a batch file is run. Variables can be changed from % 0 to % 9,
% 0 indicates the file name itself, and the string is represented in the order of % 1 to % 9.

For example, C: the name of the processing file in the root directory is F. bat, and the content is format % 1.

If c: \> f a: is executed, format:

Another example is C: The name T. bat of the batch of files processed in the root directory, and the content is type % 1 type % 2.

Run c: \> T a.txt B .txt to display the contents of a.txt and B .txt in sequence.

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.