AUTOEXEC.BAT
is a system file that was originally on DOS-type operating systems. It is a plain-text batch file in the Usage
AUTOEXEC.BAT
is read upon startup by all versions of DOS, including MS-DOS version 7.x as used in Windows 95 and Windows 98. Windows ME only parses environment variables as part of its attempts to reduce legacy dependencies, but this can be worked around.
The filename was also used by (DCP), an MS-DOS derivative by the former East-German VEB Robotron.
In Korean versions of MS-DOS/PC DOS 4.01 and higher (except for PC DOS 7 and 2000), if the current country code is set to 82 (for Korea) and no /P:filename
is given and no default AUTOEXEC.BAT
is found, COMMAND.COM
COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot (init proc ...
will look for a file named KAUTOEXE.BAT
instead in order to ensure that the DBCS frontend drivers will be loaded even without properly set up CONFIG.SYS
and AUTOEXEC.BAT
files.
Under DOS, the file is executed by the primary copy of the command-line processor (typically COMMAND.COM
) once the operating system has booted and the CONFIG.SYS
CONFIG.SYS is the primary configuration file for the DOS and OS/2 operating systems. It is a special ASCII text file that contains user-accessible setup or configuration directives evaluated by the operating system's DOS BIOS (typically residing ...
file processing has finished. While DOS by itself provides no means to pass COMMAND.COM
for AUTOEXEC.BAT
processing, the alternative command-line processor 4DOS.INI
''AutoExecParams
'' directive and //AutoExecParams=
startup option to define such parameters. Under STARTxxy.BAT
(if it exists) or the generic AUTOEXEC.BAT
startup file, %1
holds the virtual console number, %2
the 2-digit terminal number (xx) (with 00 being the main console) and %3
the 1-digit session number (y).
Windows NT and its descendants Windows XP and Windows Vista parse AUTOEXEC.BAT
when a user logs on. As with Windows ME, anything other than setting environment variables is ignored. Unlike CONFIG.SYS
, the commands in AUTOEXEC.BAT
can be entered at the interactive command line interpreter. They are just standard commands that the computer operator wants to be executed automatically whenever the computer is started, and can include other batch files.
AUTOEXEC.BAT
is most often used to set environment variables such as keyboard, soundcard, printer, and temporary file locations. It is also used to initiate low level system utilities, such as the following:
* Example
In early versions of DOS,AUTOEXEC.BAT
was by default very simple. The DATE
and TIME
commands were necessary as early PC and XT class machines did not have a battery backed-up real-time clock as default.
KEYB FR
for the French keyboard) was also included. Later versions were often much expanded with numerous third-party device drivers. The following is a basic DOS 5 type AUTOEXEC.BAT
configuration, consisting only of essential commands:
PROMPT
Prompt may refer to:
Computing
* Command prompt, characters indicating the computer is ready to accept input
* Command Prompt, also known as cmd.exe or cmd, the command-line interpreter in some operating systems
* Prompt (natural language), instr ...
command sets the CONFIG.SYS
, and programs were loaded in the AUTOEXEC.BAT
file. Some devices, such as mice, could be loaded either as a device driver in CONFIG.SYS
, or as a TSR in AUTOEXEC.BAT
, depending upon the manufacturer.
In GOTO %CONFIG%
line informs DOS to look up menu entries that were defined within CONFIG.SYS
. Then, these profiles are named here and configured with the desired specific drivers and utilities. At the desired end of each specific configuration, a GOTO
command redirects DOS to the :END
section. Lines after :END
will be used by all profiles.
Dual-booting DOS and Windows 9x
When installing Windows 95 over a preexisting DOS/Windows install,CONFIG.SYS
and AUTOEXEC.BAT
are renamed to CONFIG.DOS
and AUTOEXEC.DOS
. This is intended to ease dual booting between Windows 9x and DOS. When booting into DOS, they are temporarily renamed CONFIG.SYS
and AUTOEXEC.BAT
. Backups of the Windows 9x versions are made as .W40
files.
Windows 9x also installs MSDOS.SYS
MSDOS.SYS is a system file in MS-DOS and Windows 9x operating systems.
In versions of MS-DOS from 1.1x through 6.22, the file comprises the MS-DOS kernel and is responsible for file access and program management. MSDOS.SYS is loaded by the DOS BI ...
, a configuration file, which will not boot Windows 95/98 if parameterBOOTGUI=0
is loaded, and instead a DOS prompt will appear on the screen (Windows can still be loaded by calling the WIN
command (file WIN.COM). This file contains some switches that designate how the system will boot, one of which controls whether or not the system automatically goes into Windows. This "BootGUI" option must be set to "0" in order to boot to a DOS prompt. By doing this, the system's operation essentially becomes that of a DOS/Windows pairing like with earlier Windows versions. Windows can be started as desired by typing WIN
at the DOS prompt.
When installing AUTOEXEC.BAT
, while the file used by the DR-DOS COMMAND.COM
is named AUTODOS7.BAT
, referred to by the startup parameter /P:filename.ext
in the SHELL directive. It also differentiates the CONFIG.SYS
CONFIG.SYS is the primary configuration file for the DOS and OS/2 operating systems. It is a special ASCII text file that contains user-accessible setup or configuration directives evaluated by the operating system's DOS BIOS (typically residing ...
file by using the name DCONFIG.SYS
.
OS/2
The equivalent toAUTOEXEC.BAT
under OS/2 is the OS/2 STARTUP.CMD
file, however, genuine DOS sessions booted under OS/2 continue to use AUTOEXEC.BAT
.
Windows NT
On Windows NT and its derivatives, Windows 2000, Windows Server 2003 and Windows XP, the equivalent file is calledAUTOEXEC.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 a 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
Set, The Set, SET or SETS may refer to:
Science, technology, and mathematics Mathematics
*Set (mathematics), a collection of elements
*Category of sets, the category whose objects and morphisms are sets and total functions, respectively
Electro ...
and PATH
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-formatted) or to keep the variables across a reinstall. This is an exotic usage today so the file usually remains empty. The See also
*References
{{DEFAULTSORT:Autoexec.Bat DOS files Configuration files MSX-DOS