A+ Certification / Beginners

autoexec.bat

After command.com loads and initializes, it is configured to look for and process autoexec.bat. autoexec.bat is a batch file. Batch files simply store a list of commands that are executed in order, and autoexec.bat is configured to be executed at boot. In addition to executing programs, autoexec.bat is used to set environment variables and load TSRs (Terminate Stay Resident programs).

autoexec.bat is used to set environment variables, such as the location of the temporary directory and the search path. Windows 9x will enforce certain variables and settings prior to executing autoexec.bat, which allows you to change, append, or replace any of these values. The default values for the Windows 9x autoexec.bat are listed in Table below. Since the temporary directory is set to the Windows directory, many people change at least this one path to point to a different location, so that temporary files do not fill the Windows directory. If you want to add to the default system path, you can do so with a statement such as:

SET PATH = %PATH%;C:\MYAPPS;

This will add to the existing path (%path%), rather than overwrite it. If win.com is not called during autoexec.bat, then command.com will process the call to win.com.

Default autoexec.bat Values
Variable 	Value
Tmp 		C:\windows
Temp 		C:\windows
Path 		C:\windows;C:\windows\command
Prompt 		$p$g
Comspec 	C:\windows\command.com

As with the config.sys file, MS-DOS and Windows 9x can function without autoexec.bat - though if the autoexec.bat file is missing under MS-DOS, you are prompted to confirm the date at every boot-up.

Windows 2000 and XP will read the autoexec.bat file, but they ignore lines that execute programs or load TSRs. The only items or lines that are used out of the autoexec.bat file are statements that set environment variables, such as the system path.

[Previous] [Contents] [Next]