Role of AUTOEXEC.BAT in MS-DOS 6.22 Boot Sequence
The AUTOEXEC.BAT file serves as the final,
user-configurable stage of the MS-DOS 6.22 startup process,
automatically executing a series of commands every time the computer
boots. Positioned directly after the operating system kernel and core
system drivers are initialized, this root-directory batch script
establishes the operating environment, configures global system
variables, loads essential background utilities, and determines whether
the system stops at the command prompt or launches directly into an
application or graphical shell.
Position in the Boot Order
During the MS-DOS 6.22 boot sequence, the machine progresses through
hardware power-on self-tests (POST), the Master Boot Record, and the
core files IO.SYS and MSDOS.SYS. The operating
system then processes CONFIG.SYS, which configures
low-level system settings, memory management architectures (such as
HIMEM.SYS and EMM386.EXE), and hardware device
drivers.
Once CONFIG.SYS completes, IO.SYS loads the
primary command processor, COMMAND.COM.
COMMAND.COM immediately searches the root directory of the
boot drive for AUTOEXEC.BAT (short for "automatic execution
batch"). If found, the command interpreter executes every command within
this file sequentially before handing control over to the user.
Core Functions of AUTOEXEC.BAT
In MS-DOS 6.22, AUTOEXEC.BAT performs several critical
configuration tasks that transform the raw command environment into a
functional workspace:
- Defining Environment Variables: It sets crucial
environment variables using the
SETcommand. The most vital is thePATHvariable, which specifies the directories the system searches when a command or program is executed. It also sets variables likeTEMPorTMPto define scratchpad directories for programs. - Customizing the Command Interface: The
PROMPTcommand defines how the command prompt appears. The standardPROMPT $P$Gcommand displays the current drive letter and active directory followed by a greater-than symbol (e.g.,C:\DOS>). - Loading TSRs and Peripheral Utilities: Unlike
low-level drivers loaded via
DEVICE=inCONFIG.SYS, several critical utilities operate as Terminate-and-Stay-Resident (TSR) programs loaded inAUTOEXEC.BAT. Typical examples include:SMARTDRV.EXEto enable disk caching for faster read/write operations.MSCDEX.EXEto provide MS-DOS extensions for reading ISO-9660 CD-ROM drives.- Mouse utilities (such as
MOUSE.COM). DOSKEY.EXEfor command-line history and macro functionality.
- Memory Optimization: In conjunction with MS-DOS
6.22's memory management, TSRs inside
AUTOEXEC.BATare frequently prefaced with theLHorLOADHIGHcommand. This instructs DOS to load these utilities into Upper Memory Blocks (UMBs), preserving the critical 640 KB conventional memory space for applications. - Multi-Configuration Processing: MS-DOS 6.22
introduced native multi-boot menus defined in
CONFIG.SYS.AUTOEXEC.BATsupports this by reading the%CONFIG%environment variable, using labels andGOTOstatements to execute specific configurations depending on the user's startup menu selection. - Auto-Starting Applications: The script can
terminate with a command that immediately starts a program, such as a
file management utility, an enterprise database system, or the
WINcommand to launch Windows 3.1 or Windows for Workgroups 3.11.
If AUTOEXEC.BAT is missing from the boot drive,
COMMAND.COM bypasses the automated configuration, prompts
the user manually for the current date and time, and drops directly to a
standard C:\> prompt with minimal environment
configuration.