Autoexec.bat and config.sys were the initial startup files for all versions of MS-DOS; if autoexec.bat did not exist, then the computer would prompt for the time and date, a hang-on from the days before non-battery backed CMOS.

Autoexec.bat was just as any normal MS-DOS batch file, and was the last step in the boot sequence. Some drivers required loading both in config.sys and autoexec.bat, often with matching parameters in both - CD-ROM drivers were notable for this. It was also the easiest place to use the internal set command, to configure how dir displayed directories: I preferred ,set dircmd=/p /w /o:gne, which sorted the files and displayed just their names, splayed across the screen, and pausing every time the screen filled. Other settings included 'blaster' which allowed the SoundBlaster to be configured with the correct IRQ and other settings. Prompts could be configured in the same way. External programs (Windows, menuing programs) could be started up at the end of the batch file.

Many programs had to modify either config.sys or autoexec.bat when installed, particularly anti-virus software which needed to be run on bootup or to install itself into memory as a TSR. This invariably led to a preponderance of backups of autoexec.bat and config.sys with various extensions lurking in the root directory.

Log in or register to write something here or to contact authors.