What is bat

  
                  

bat: batch file. In MS-DOS, a .bat file is an executable file consisting of a series of commands, which can contain calls to other programs.

First, the batch file can be edited in text mode.

Each line of this file is a DOS command (most of the time it is like the command line we executed at the DOS prompt) You can create and modify batch files using any text file editing tool such as Edit under DOS or Notepad on Windows.

Secondly, the batch file is a simple program

The conditional statement (if) and the flow control statement (goto) can be used to control the flow of the command. It can also be used in batch processing. Use a loop statement (for) to loop through a command. Of course, the programming ability of batch files is very limited compared with programming statements such as C language, and it is also very irregular. A batch of program statements is a DOS command (including internal and external commands), and the ability to batch depends on the command you are using.

Third, each prepared batch file

is equivalent to a DOS external command

You can put the directory where it is located in your DOS search In the path so that it can run anywhere. A good habit is to create a bat or batch directory on the hard disk (for example, C:\\BATCH), and then put all the batch files you wrote into the directory, so just set c:\\batch in the path, you You can run all the batch programs you write in any place.

Fourth, under DOS and Win9x/Me system

C: The AUTOEXEC.BAT batch file in the root directory is automatically run batch file, which will be automatically generated every time the system starts. Run this file, you can put the system to run the command every time you start, such as setting the search path, dialing the mouse driver and disk cache, setting system environment variables.

Copyright © Windows knowledge All Rights Reserved