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