Config.sys is a text file used by MS-DOS and 16-bit versions of Microsoft Windows that is used to configure computer hardware at startup.

The config.sys file is used to configure a machine’s memory, keyboard, mouse, printer, and other peripherals. The config.sys file is an ASCII file that can be edited with any text editor.

Config.sys is editable in MS-DOS Editor
Config.sys is editable in MS-DOS Editor

A typical config.sys file includes commands such as device, lastdrive, and dos. Device commands are used to load device drivers for different hardware, such as the extended memory driver himem.sys. Lastdrive specifies the highest available drive letter.

Dos allows you to load MS-DOS into the high memory area and to give programs access to the upper memory area.

After the config.sys file’s commands are executed, the autoexec.bat file is executed. Windows 95 and Windows 98 also include a config.sys file, but it is present only for backward compatibility with 16-bit Windows applications running under Windows 95 or Windows 98.

Config.sys file example

The config.sys file is editable in MS-DOS Editor or any other text editor available.

Here is an example of the content of a typical config.sys file:


The next table will explain, line by line, every command on the Config.sys file.

DEVICE=C:\Windows\HIMEM.SYSThe Himem.sys line is an important line; this line allows you to load drivers into high memory. If this line is not present, Windows 3.x will not load.
DOS=HIGH,UMBLoad DOS into high memory in an upper memory block. Note the location usually best placed after the
DEVICE=C:\Windows\EMM386.EXE NOEMSThe EMM386 line loads the extended memory manager. However,
some older MS-DOS games have problems with extended memory and will not run without the NOEMS statement.
FILES=30The files line allow Windows to load 30 files at the same time.
However, going higher may decrease the computer’s performance;
30 is found to work the best. Also, make sure that this line is all as one line and that there is not a space between and after the =.
STACKS=0,0The stacks line was first used in MS-DOS 3.2 and was used to swap the stack whenever an asynchronous hardware interrupt occurred. Later in MS-DOS 3.3 the line STACKS=0,0 was added into the config.sys. In special circumstances, this line was changed to STACKS=9,128. The STACKS statement has a range of 8-64, 32-512. If a higher value is entered, you will receive a “FATAL: Internal stack failure, system halted error.”
BUFFERS=20Buffers line is to load buffers into memory allowing Windows to load memory.
DEVICEHIGH=C:\Windows\COMMAND\ANSI.SYSThe ansi.sys line is a driver for DOS to allow you to have different colors and sizes and special characters at the DOS prompt.
DEVICEHIGH=C:\MTMCDAI.SYS /D:123The CD-ROM drivers for the CD-ROM drive. The /D:123 represents the name of the driver, which in this case is named 123, however, can be named anything, usually MSCD0001. However, keep in mind that the /D:123 must be the same in config.sys and autoexec.bat. If they are different, the CD-ROM will not work in MS-DOS.
LASTDRIVE=Allows you to specify the last drive installed on the computer. It is not recommended this line be used unless you are using Windows 3.11 or earlier since later version of Windows ignore this line.
FCBS=A line used to specify the number of file control blocks for file sharing. Should only be used when programs require it, and today, is not used or required. FCBS can utilize between 1 and 255.

If a config.sys file exists in the boot partition on a computer running Windows NT, it will be parsed at startup.


Articles posted after being checked by editors.

Recent Posts