echo command and text in batch processing _dos/bat

Source: Internet
Author: User

1. Echo

Displays the status of the current echo: echo on or echo off

2. ECHO on

Setting the Echo state to on will display the command line, which is similar to the previous c:\>, as shown in the figure:

3. ECHO off

Setting the echo state to off will not display the command line, which is similar to the previous c:\>, and the user can enter commands or display command results as shown in the figure:

4. ECHO string

Displays the input string on the cmd screen. As shown in the figure

5. ECHO string &echo string ...

Used to display multiple rows of data, as shown in the following example:

6. ECHO string > file path and filename

Writes a string to a file, and if there is already data in the file, it is automatically emptied before being written. As shown in the figure:

(1)

(2)

(3)

7. ECHO string >> file path and filename

Writes a string to a file and appends the string to the end of the file if there is already data in the file. As shown in the figure:

(1)

(2)

(3)

S

8. (ECHO string &echo string ...) > File path and file name

Write multiple rows of data in a file (note that parentheses cannot be removed, and if parentheses are removed, only the last one will be written, and the preceding output is in the cmd window). If there is already data in the file, it will be automatically emptied before writing.

9. (ECHO string &echo string ...) >> path and filename

Write multiple rows of data in a file (note that parentheses cannot be removed, and if parentheses are removed, only the last one will be written, and the preceding output is in the cmd window). If there is already data in the file, append the string to the end of the file.

(ECHO string) >> file path and filename

Appends a string to another line in the file. As shown in the figure:

(1)

(2)

(3)

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.