Hack #93. Hack the MS-DOS Startup File

Set up DOS environment parameters and load utilities and virus protection before Windows takes over your PC.

The AUTOEXEC.BAT file resides in the root directory of your boot drive (typically C:\) and contains commands that configure the appearance of DOS and loading of transient or terminate-and-stay-resident (TSR) programs at bootup. The DOS command processor, COMMAND.COM, loads and looks for and reads AUTOEXEC.BAT after the contents of the CONFIG.SYS file are processed. AUTOEXEC.BAT is a text file you can edit with DOS EDIT.COM, Windows Notepad, or any text editor program. CONFIG.SYS is used by DOS 6.22 and earlier and Windows 95-Me, but is not used by Windows NT, 2000, XP, or 2003.

Under Windows 95 through Me, a few basic DOS parameters are preset within the IO.SYS boot file. These consist of the DOS prompt (C:\>) and the PATH to DOS and Windows files.

Tip

You can bypass CONFIG.SYSand AUTOEXEC.BAT files if BootKeys=1 is configured in MSDOS.SYS [Hack #91] . To use this feature, press the F5 key when you see the "Starting MS-DOS..." or "Starting Windows.." notice at startup.

You can also "walk through" and accept or reject individual CONFIG.SYS and AUTOEXEC.BAT commands by pressing the F8 key instead of F5.

If you are running Windows 95-98SE, WIN.COM is loaded by default, although it doesn't appear in AUTOEXEC.BAT. Windows Me does not load DOS or process a CONFIG.SYS or AUTOEXEC.BAT file at startup but will bypass loading Windows and run DOS ...

Get PC Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.