AUTOEXEC.BAT

From Free net encyclopedia

AUTOEXEC.BAT is the name of a system file found on the MS-DOS operating system. It is a plain-text batch file that is located in the root directory of the boot device.

Usage

AUTOEXEC.BAT is only used on MS-DOS or Microsoft Windows versions based on MS-DOS, such as Windows 3.x, Windows 95, Windows 98, and Windows Me. The file is executed once the operating system has booted and after the CONFIG.SYS file has been processed. On Windows, this occurs before the graphical environment has been started.

AUTOEXEC.BAT is most often used to set environment variables and run virus scanners, system enhancements, utilities, and driver handlers that must operate at the lowest level possible. Applications that run within the Windows environment upon its loading are listed in the Windows registry.

Lines prefixed with the string "REM" are remarks and are not run as part of AUTOEXEC.BAT. The "REM" lines are used for comments or to disable drivers (say, for a CD-ROM).

Windows NT

On Windows NT and its derivatives, Windows 2000 and Windows XP, the equivalent file is called AUTOEXEC.NT and is located in the %SystemRoot%\system32 directory. The file is not used during the operating system boot process; it is executed when the MS-DOS environment is started, which occurs when an MS-DOS application is loaded.

The AUTOEXEC.BAT file may often be found on Windows NT, in the root directory of the boot drive. Windows only considers the "SET" statements which it contains, in order to define environment variables global to all users. Setting environment variables through this file may be interesting if for example MS-DOS is also booted from this drive (this requires that the drive be FAT) or to keep the variables across a reinstall. This is an exotic usage today so this file remains almost always empty. The TweakUI applet from the PowerToys collection allows to control this feature (Parse Autoexec.bat at logon).

See also

nl:Autoexec.bat pl:AUTOEXEC.BAT