is the configuration file for the DOS and OS/2 operating systems that specifies startup options options that cannot be changed after the system has booted. The data it contains is read by the system and used to configure many aspects including memory management, peripherals and applications. Each line can contain a name-value pair that is either a directive that sets the value of a system setting or with name "DEVICE" extends system capability by loading a file such as a device driver or a terminate-and-stay-resident (TSR) program. was introduced with DOS 2.0.

As Windows technology diverged from DOS over time, use of diminished. Both and are in the root folder of the Windows 95 and Windows 98 boot drives, but typically, they are empty. Windows Me does not use a CONFIG.SYS file at all. Instead, it loads environment variables from the Windows Registry key: HKLM\System\CurrentControlSet\Control\SessionManager\Environment.

Use

User maintained The file is maintained by a user in order to control the behavior of the system. As an ASCII text file, a user generally edits it via a text editor.

System consumed During boot, the DOS BIOStypically resides in or loads the file from the root directory of the drive from which the system boots. After processing the file, the system loads and executes the command shell specified in the SHELL line, or if there is no such line. The command shell in turn is responsible for processing the file.

Missing/corrupt Even though loading CONFIG.SYS is part of a normal bootup process, the system can boot if the file is missing or corrupt. A system probably requires troubleshooting if the file gets deleted or corrupted.

Default shell If does not contain a SHELL directive (or the file is corrupt or missing), DOS typically searches for in the root directory of the boot drive. If this is not found, versions of DOS before 6.0 will not start up. MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and higher will instead display a prompt to enter the path and filename of a command processor. This recovery prompt is also displayed when the primary command processor is aborted due to faults or if it is exited deliberately. (In the case of , the internal EXIT command is disabled only when the shell was started with /P.) This also provides limited means to replace the shell at runtime without having to reboot the system. Since the MS-DOS 7.0 and higher COMMAND.COM executable is incompatible with DR-DOS, but typically resides in the root of drive C: in dual-boot scenarios with DR-DOS, DR-DOS 7.02 and higher no longer allow to bypass SHELL directives in (+)// "skip"/"trace"/"step" modes. (Some later issues added (+) to reinvoke the former "skip" behaviour in order to allow recovery from problems with invalid SHELL arguments as well.) Also, if no SHELL directive could be found when skipping processing via (+) (and also with (+)/, when the default file extension has been changed with SYS /DR:ext), the user is prompted to enter a valid shell file name before trying to load COMMAND.COM from the root. Pressing without specifying a file will assume the former default.

File size limit Depending on the version, the size of the file is limited to a few kilobytes under MS-DOS/PC DOS (up to 64 KB in most recent versions), whereas the file's size is unlimited under DR-DOS. This is because the former operating systems (since DOS 3.0) will compile the file into some tokenized in-memory representation before they sort and regroup the directives to be processed in a specific order (with device drivers always being loaded before TSRs), whereas DR-DOS interprets the file and executes most directives line-by-line, thereby giving full control over the load order of drivers and TSRs via DEVICE and INSTALL (for example to solve load order conflicts or to load a program debugger before a device driver to be debugged) and allowing to adapt the user interaction and change the flow through the file based on conditions like processor types installed, any type of keys pressed, load or input errors occurring, or return codes given by loaded software. This becomes particularly useful since INSTALL can also be used to run non-resident software under DR-DOS, so that temporary external programs can be integrated into the CONFIG.SYS control flow.

Data limits In MS-DOS/PC DOS 2.0 through 4.01, the length of the SHELL line was limited to 31 characters, whereas up to 128 characters are possible in later versions. DR-DOS even accepts up to 255 characters. directives do not accept long filenames.

Dual booting DOS and Windows 9x When installing Windows 95 over a preexisting DOS/Windows install, and are renamed to and . This is intended to ease dual booting between Windows 9x and DOS. When booting into DOS, they are temporarily renamed and . Backups of the Windows 95 versions are made as and files.

When Caldera DR-DOS 7.02/7.03 is installed on a system already containing Windows 95, Windows' and retain those names. DR-DOS' startup files are installed as (a name already used in earlier versions of DR DOS) and .

OS/2 OS/2 uses a file for configuring options, drivers and environment before the graphical subsystem loads. There are many undocumented or poorly documented directives used by OS/2. continues to be used by the OS/2 derivatives eComStation and ArcaOS. In the OS/2 subsystem of Windows NT, what appeared as to OS/2 programs is actually stored in the registry.

Example

An example CONFIG.SYS for MS-DOS 5: DOS=HIGH,UMB DEVICE=C:\DOS\HIMEM.SYS DEVICE=C:\DOS\EMM386.EXE RAM DEVICEHIGH=C:\DOS\ANSI.SYS FILES=30 SHELL=C:\DOS\COMMAND.COM C:\DOS /E:512 /P

Variations Some DOS variants load a file with an alternate name if its exists instead of loading from the default CONFIG.SYS:

CCONFIG.SYS While Concurrent DOS versions 3.2 to 4.1 did not support CONFIG.SYS, later versions, Concurrent DOS 386 and Concurrent DOS XM, as well as Multiuser DOS, System Manager and REAL/32 load CCONFIG.SYS (initial "C" referring to "Concurrent") instead of CONFIG.SYS. Some versions of Multiuser DOS use a filename of CCONFIG.INI instead, whereas REAL/32 is known to look for MCONFIG.SYS. These operating systems support many additional and different configuration settings (like INIT_INSTALL) not known under MS-DOS/PC DOS, but they are stored in the binary repository named CCONFIG.BIN rather than in CCONFIG.INI. Both files are typically modified through a configuration utility named CONFIG.EXE only. DCONFIG.SYS DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02 and higher, a file named DCONFIG.SYS (initial "D" referring to "DR DOS"), if present, takes precedence over CONFIG.SYS. Since DR DOS 6.0, this was used in conjunction with disk compression software, where the original boot drive C: would become drive D: after loading the compression driver (and the "D" in the file name came in handy as well), but it is commonly used to help maintain multiple configuration files in multi-boot scenarios. ODCONFIG.SYS OpenDOS 7.01 and DR-OpenDOS 7.02 look for a file named ODCONFIG.SYS, whereas some issues of DR-DOS 7.02 and higher instead also look for DRCONFIG.SYS. Under DR DOS 6.0 and higher, the SYS /DR:ext command can be used to change the default file extensions. For example, with SYS /L /DR:703 the written Volume Boot Record would look for a renamed and modified IBMBIO.703 system file (instead of the default IBMBIO.COM) and the IBMBIO.703 would look for IBMDOS.703 and [D]CONFIG.703 (instead of IBMDOS.COM and [D]CONFIG.SYS), so that multiple parallel sets of files can coexist in the same root directory and be selected via a boot-loader like LOADER, supplied with Multiuser DOS and DR-DOS 7.02/7.03. The SHELL directive is enhanced to provide means to specify alternative AUTOEXEC.BAT files via /P[:filename.ext] and in this specific scenario, COMMAND.COM will accept file extensions other than ".BAT" as well (both features are also supported by 4DOS). Under DR DOS 6.0 and higher, the CONFIG.SYS directive CHAIN=filespec can be used to continue processing in the named file, which does not necessarily need to reside in the root directory of the boot drive. DR-DOS 7.02 and higher optionally support an additional parameter as in CHAIN=filespec,label to jump to a specific :label in the given file. DR-DOS 7.03 and higher support a new SYS /A parameter in order to copy the corresponding CONFIG.SYS and AUTOEXEC.BAT files along with the system files. FDCONFIG.SYS Used by FreeDOS. RXCONFIG.SYS Used by RxDOS 7.24 and higher. CONFIG.PTS Used by PTS-DOS.

Other variations include: CONFIG.SYS is used by (DCP), an MS-DOS derivative by the former East-German VEB Robotron. Under FlexOS, CONFIG.SYS is a binary file defining the resource managers and device drivers loaded.

Content The content of a CONFIG.SYS file and its many variants is described below. Each item describes a directive, load command or another syntactic element.

Comment Starts a comment as long as no text precedes it on a line. Starts a comment and unlike can follow a directive to form an in-line comment. See . In MS-DOS/PC DOS, the inline-comment is not ignored if put in double-quotes. Starts a comment like semi-colon (;).

Load file Similar to under DOS, loads programs in CONFIG.SYS. Similar to under OS/2, but runs in foreground and halts CONFIG.SYS processing until return. Loads a device driver into memory. Loads a device driver into upper memory. (Same as in DRDOS 5.0.) See . See . Installs a TSR program into memory, like , but installs after the DOS data segment relocation. Compare also: INSTCDEX. Installs a TSR program into memory. Installs a TSR program into upper memory. (Same as in DR DOS 5.0.) Installs a TSR program into memory, like , but installs after the DOS data segment relocation. Compare also: INSTCDEX. Similar to , loads programs in CONFIG.SYS. Similar to under DOS and under OS/2, but loads programs in background concurrently.

Directive

Specifies if programs can be aborted on errors. Configures which drives should store file access date stamps in the reserved area of directory entries in FAT file systems. Conditional execution on AT-compatible machines only. Boot manager. Configures verbosity of error messages. Changes internal default serial device driver ( to ) for device. Disables the availability of character devices outside phantom \DEV directory. Loads base device driver into memory. Emits a short beep, even if audible notifications are disabled via . Specifies operating system to be booted. Sets or clears extended checking. Specifies the number of disk buffers to allocate. Same as , but explicitly loads buffers into HMA or UMB (like under DR DOS 6.0 and higher). Maximum number of 512-byte cache blocks dynamically allocated from system pool. Maximum time in ms before unused cache blocks are returned to system pool. Maximum time in ms before a dirty cache block gets flushed to disk. Specifies whether the keyboard status is turned on or off. Specifies the name of the CD-ROM hardware driver. Specifies the number of buffers for CD-ROM access. Specifies the type of clock used by the system. Specifies the OEM codepage(s). Specifies the address of the CMOS RAM. Specifies colors for boot menus. Defines count and logical order and configures I/O address and timeout for COM1: device. Defines count and logical order and configures I/O address and timeout for COM2: device. Defines count and logical order and configures I/O address and timeout for COM3: device. Defines count and logical order and configures I/O address and timeout for COM4: device. Specifies buffer for DMA. Redefines the lead-in character(s) for CONFIG.SYS inline-comments, or causes the following line to be ignored. Enables and configures international support. Sets display cursor to specified position for configuration menus. For codepage switching support. Specifies RAM refresh speed. Conditional execution on 8088 CPUs only.