[Original] windows Batch Processing Command Learning 1

Source: Internet
Author: User

Author: Zhu Jincan

Source: http://blog.csdn.net/clever101

 

Windows batch processing commands are not as powerful as UNIX shell scripts, but they can still play a great role in our work. A friend asked me why I learned the batch processing command 《ProgramA sentence in the book from the employee to the expert: the advantage of the graphic interface is what you see is what you get. The disadvantage of the graphic interface is that what you see is what you get, the combination of batch processing commands is powerful and quick. Now let's learn about it. (The following red words are batch processing commands)

 

Basic commands:

 

@ Echo off

Echo refers to the loop. Echo off refers to the echo function. the previous @ indicates that the echooff line does not show back. You can try to remove @ and the whole line. another function of @ is to automatically restore the command echo when the batch processing file is executed.

 

Practice:

 

1. Create a 1.bat in a directory and input the following commands to the file:

@ Echo off

Dir

And

Echo off

Dir

And

Dir, and then run 1.baton the command console to see what's different?

 

 

Call

Call [drive:] [path] filename [batch-parameters]

Batch-parameters specifies the command line information required by the batch processing program.

Practice:

Create a batch processing file echo. bat on drive C

Echo % 1

Then, enter the command in the command line window:

Call c: \ echo. Bat "Thisis a test"

See what the effect is.

Pause

Pause the execution of the batch processing program and display a message prompting you to press any key to continue execution. You can only use this command in a batch processing program.


Rem

It indicates that the character after this command is interpreted as a line (comment). If it is not executed, it is only used for future reference (equivalent to a comment in the program ).

At the same time, you can use two colons to replace REM. for example: equivalent to a rem. but there is a difference between them: for comments, he does not echo, even if you play echo on to force echo, it is not the same. at the same time, REM can be used in config. comment in SYS.

Syntax: REM [commnet]

A small experience of batch processing commands: I always want to use them, especially when performing batch operations.

 

 

Author: clever101 posted on 23:00:03 Original article link Read: 317 comments: 0 views comments

Related Article

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.