What is autoexec.bat?

 What is autoexec.bat? Disk Operating System Batch Files DOS
AUTOEXEC.BAT Batch Files

     A special-purpose batch file (set of commands) that is automatically carried out by the MS-DOS operating system whenever the computer is started or restarted. The file contains basic startup commands that help configure (tailor) the system to install devices and to the user's preferences.

DOS BATCH COMMANDS
@ Does not echo back the text after the at symbol. This is most commonly used as @ECHO OFF to prevent any of the commands in the batch file from being displayed just the information needed.
%1 The percent followed by a numeric value, beginning with one, allows users to add variables within a batch file. The following is a batch file example:
echo Hello %1
When the above one line batch file is created and adding your name after the batch file. For example typing myname (being the name of the bat file) and then your name:
myname bob 
would output
Hello bob
:LABEL By adding a colon in front of a word such as LABEL you create a category, more commonly known as a label. This allows you to skip to certain sections of a batch file such as the end of the batch file. Also see GOTO.
CALL This is used to run another batch file within a batch file. When the batch file that is called is completed the remainder of the original batch file is completed.  Note if the batch file does not exist it will give an error message.
CHOICE Running different programs.
CLS Just like the DOS command would clear your screen.
ECHO Will echo a message in the batch file. Such as "ECHO Hello World" will print Hello World on the screen when executed. Note if you have not typed @ECHO OFF at the beginning of the file this will also print "ECHO Hello World" and "Hello World". If you would just like to create a blank line type ECHO. adding the period creates an empty line.
EXIT Exits out of the DOS window if the batch file is ran from Windows.
GOTO LABEL Used to go to a certain label such as LABEL. An example of GOTO would be to GOTO END.
IF Used to check for a certain condition if the condition exists. If that condition exists it will perform that function..
PAUSE Prompt the user to press any key to continue.
REM Allows you to place comments into the batch file without displaying or executing that line when the batch file is ran.
SHIFT Changes the position of replaceable parameters in a batch program. You can use this command only in batch programs.
START Used for Windows 95, Windows 98, and Windows NT 4.0 and above to start a windows application such as START C:\WINDOW\CALC would run the Windows Calculator. Users running Windows 3.x need to utilize the WIN command.

More on this subject
Beginner's Help
BUG Club Home

 What is autoexec.bat? Disk Operating System Batch Files DOS