Jump to content

STRING (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article STRING (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryOperating systems
Founded1983
ProductsSystem configuration directives for DOS and OS/2

CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, holds setup instructions that the operating system’s DOS BIOS—usually found in IBMBIO.COM or IO.SYS—interprets during the boot process. The CONFIG.SYS file was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are used to configure DOS settings related to hardware devices, software applications, and memory allocation. Once CONFIG.SYS is processed, DOS initiates the command interpreter designated by the SHELL directive; if none is specified, it defaults to COMMAND.COM, which then executes commands from AUTOEXEC.BAT.

Most entries in CONFIG.SYS follow a name=value format to adjust system parameters or load components like device drivers and terminate-and-stay-resident programs (TSRs). This file is located in the root directory of the system’s boot drive.

Certain DOS versions look for alternative configuration filenames that override CONFIG.SYS:

- Advanced editions such as Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI instead. They also maintain additional settings in a binary file called CCONFIG.BIN, which is commonly managed through CONFIG.EXE. - In DR DOS 3.31 and later releases, DCONFIG.SYS takes precedence over CONFIG.SYS, supporting features like disk compression and multi-boot configurations. - Versions OpenDOS 7.01 and DR-OpenDOS 7.02 additionally check for the presence of ODCONFIG.SYS or DRCONFIG.SYS. - DR-DOS 6.0 and newer allow customization of default config file extensions using SYS /DR:ext, facilitating multiple system setups selectable via boot loaders such as LOADER. - The SHELL command supports specifying alternative AUTOEXEC.BAT files through /P[:filename.ext], functionality also available in 4DOS. - DR-DOS includes a CHAIN=filespec[,label] directive to continue processing supplementary configuration files, even if they reside outside the root directory. - Starting with DR-DOS 7.03, the SYS /A command copies CONFIG.SYS and AUTOEXEC.BAT alongside other system files.

Comparable approaches exist in other operating systems: - FDCONFIG.SYS is used by FreeDOS - RXCONFIG.SYS is utilized by RxDOS - CONFIG.PTS is employed by PTS-DOS

In Windows 95 and Windows 98, CONFIG.SYS along with AUTOEXEC.BAT remain located in the root directory but are generally empty. Windows Me no longer processes CONFIG.SYS at startup; instead, it loads environment variables directly from the Windows Registry.

For FlexOS, CONFIG.SYS differs as a binary configuration file that specifies resource managers and device drivers to be loaded during system initialization.

Example

Below is a sample CONFIG.SYS configuration for MS-DOS 5: <syntaxhighlight lang="ini" line="1"> 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 </syntaxhighlight>

:;*?!

Marks labels within CONFIG.SYS used as jump destinations for directives like , , , , and .
Functions similarly to , but permits inline comments following other CONFIG.SYS commands. (Note: MS-DOS/PC DOS does not ignore inline comments enclosed in double quotes.)
Initiates inline comments alongside the ; directive.
Prompts users with a Yes/No question before executing subsequent CONFIG.SYS commands. (FreeDOS does not support custom messages but allows conditional execution with boot menus.) DOS versions 6.0 and above offer comparable functionality by appending after commands (e.g., ).
Executes the next CONFIG.SYS directive without prompting under any condition.

ATemplate:NbndC

Determines whether programs may be terminated upon encountering errors.
Sets drives to record file access timestamps within FAT file systems.
Enables conditional execution on AT-compatible hardware.
Functions as a boot manager.
Adjusts the level of detail in error messages.
Alters the default serial device driver assigned to the AUX: port.
Prevents character devices from being accessible outside the phantom \DEV directory.
Loads the fundamental device driver into memory.
Produces a brief beep even if notification sounds are disabled.
Indicates the subsequent operating system to boot.
Enables or disables extended Ctrl+C interrupt checking.
Defines the quantity of disk buffers to allocate.
Similar to BUFFERS but loads buffers into High Memory Area (HMA) or Upper Memory Blocks (UMB).
, ,
Manages cache block allocation and flushing policies.
Executes programs listed in CONFIG.SYS, running them in the foreground and pausing further processing until completion.
Sets the Caps Lock state on the keyboard.
,
Configures CD-ROM driver designation and buffer numbers.
Continues processing CONFIG.SYS from a specified file or label.
, , , etc.
Additional commands for system clock type, screen clearing, and OEM codepage configurations, mainly under OS/2 or PTS-DOS environments.
, ...,
Sets parameters for serial COM ports including quantity, sequence, I/O addresses, and timeout durations.
, also COMMENTS, REM
Defines inline comment characters or causes the remainder of lines to be ignored across various DOS variants.
Activates internationalization support across multiple DOS versions and OS/2.

Additional CPU-specific conditional directives include: - CPU88, CPU86, CPU286, CPU386, CPU486 and their variants control conditional execution based on processor type (supported by PTS-DOS and DR-DOS).

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Specifies memory segment address for multi-sector disk data deblocking operations.
Activates internal debugger functionality.
Operates as a boot manager.
Loads device drivers into conventional memory.
Loads device drivers into upper memory areas (equivalent to in DRDOS 5.0).
Configures country and codepage information for keyboard (KBD), screen (SCR), and printer (LPT) devices.
Sets cache memory size parameters.
Defines floppy disk compatibility mode settings.
Determines display font selection.
Controls whether DOS loads into high memory and/or utilizes upper memory blocks.
Loads DOS internal tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory regions.
Specifies an alternative directory path for DOS system files.
Sets search paths for data files.
Defines physical characteristics of disk drives.
Establishes parameters for unidentified drives.
Refer to .
Enables error logging via PDUMP.nnn files on a specified drive.
Displays standard messages on screen output.
Displays messages including ANSI escape sequences for enhanced formatting.
Implements additional verification steps when launching programs.
Assigns assumed error or return codes for subsequent commands.
Manages the A20 gate state during program startup sequences.
Terminates CONFIG.SYS processing prematurely except for certain specified directives.
Configures hash table size to optimize file opening speeds, differing from MS-DOS/PC DOS external drivers.
Sets the maximum number of cached File Control Blocks (FCBs) allowed open simultaneously (shares buffer with FILES under DR-DOS).
Similar to FCBS but explicitly loads FCBs into upper memory areas.
Functions as a boot manager utility.
Defines the maximum number of files that can be open concurrently.
Equivalent to FILES but explicitly loads file handles into upper memory segments.
Facilitates execution of specified CONFIG.SYS subsections (see IGNORE directive).

GTemplate:NbndI

Waits for a key press or timeout, returning an error level with the ASCII code or 1024 if timed out.
Resumes CONFIG.SYS processing at a specified label.
Continues nested CONFIG.SYS processing at a label, then returns to the previous point.
Refer to , , or for additional details.
See also .
Refer to .
Consult or for more information.
Look up or for related commands.
See .
Loads a TSR program following DOS data segment relocation, functioning similarly to .
Refer to , , or for further explanation.
See .
Consult or for additional context.
Activates console and command line history buffer with enhanced pattern search capabilities.
Defines the address of the HMA segment.
Configures the HLT power-saving mode.
Enables scanning of the boot sector for viruses.
Loads installable file system drivers.
Prevents execution of designated CONFIG.SYS subsections.
Permits specified applications to operate at ring 2, allowing direct hardware I/O access.
Includes directives from another menu block, emulated by GOSUB/RETURN in DR-DOS environments.
Sets the status of the keyboard Insert mode.
Installs a TSR program into memory.
Installs a TSR program into upper memory, equivalent to HIINSTALL in DR DOS 5.0.
Installs a TSR after relocating the DOS data segment, similar in function to INSTALL.
Adjusts PIC interrupt priorities to assign highest priority to a specified IRQ.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the address of the relocated keyboard buffer.
Sets the maximum number of accessible drives.
Functions like LASTDRIVE but loads Current Directory Structure (CDS) into upper memory.
Lists directories for searching DLL files.
Manages backward compatibility for legacy software.
Determines the number of file locks allowed.
Controls boot logo display, used alongside PTS-DOS boot manager.
Configures count, sequence, I/O address, and timeout settings for LPT1 device.
Applies similar configuration for LPT2 device.
Configures LPT3 device in like manner.
Enables and sets parameters for LPT4 device operation.
Sets the delay before a waiting process receives higher priority scheduling.
Defines the memory allocation approach used by DOS.
Specifies default DOS memory allocation policy.
Establishes menu options available during boot or configuration.
Sets menu color schemes, emulated via ECHO commands under DR-DOS systems.
Identifies default menu block, emulated by TIMEOUT and SWITCH commands in DR-DOS environments.
Defines individual menu blocks, emulated by ECHO and SWITCH in DR-DOS implementations.
Enables multitrack disk operations support.
Continues CONFIG.SYS processing from a new file after loading a driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Sets the default No () response character used in Yes/No/Resume prompts.
Controls keyboard [[Num Lock|Template:Keypress]] status, turning it on or off at startup.
Allows conditional execution based on previous return code or error status, such as .
Similar to and , displays text and waits for user key press input.
Requires user confirmation when errors occur during CONFIG.SYS processing.
Configures buffer size allocated to LPT ports.
Enables conditional execution on PC-compatible systems only.
Adjusts scheduling priority levels for processes.
Sets priority specifically for disk I/O programs within scheduler settings.
Changes default printer device driver assignment (e.g., from LPT1 to LPT3 or LPT4).
Determines whether DOS applications are permitted to run at all.
Loads a graphical or text-based user interface environment during startup.
Enables conditional execution exclusively on IBM PS/1-compatible hardware platforms.
Allows conditional execution only on IBM PS/2-compatible machines.
Mutes output sent to STDOUT display during operation.

RTemplate:NbndT

Activates automatic system reboot upon error detection.
Permits inclusion of comments within CONFIG.SYS (ignored by PTS-DOS).
Allocates a drive letter for local block device drivers.
Sets the default character for Resume () prompts.
Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH location, optionally passing a return code.
Specifies the size of real mode memory.
Enables concurrent loading of programs in CONFIG.SYS in the background.
Determines storage location for the first character of deleted files within the FAT reserved area.
Defines video mode settings under FreeDOS or screen access methods for PTS-DOS.
Controls the keyboard Scroll Lock status, turning it on or off.
Establishes environment variables.
Loads the command interpreter shell.
Similar to SHELL but supports pre-allocating COMMAND.COM into HMA or UMBs, minimizing fragmentation with third-party shells.
Specifies keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines whether files close upon pressing Ctrl+Alt+Del.
Bypasses POST during reboot.
, STACKSIZE, STACKSHIGH
Configure stack sizes and buffer locations for hardware interrupts across various DOS versions, with some ignored in newer DR-DOS releases.
, SYSBOOT, SYSGEN, SYSLOAD
PTS-DOS commands managing boot processes and system memory setup.
(DOS 6.0+) Defines submenu blocks, a feature not supported by DR-DOS or FreeDOS.
, SWAPPATH, THREADS, TIMESLICE
OS/2-specific parameters controlling error logging paths, swap file locations, thread concurrency, and scheduler time slices.
, SWITCHES
Conditional directives within CONFIG.SYS for DR-DOS and Novell DOS, with certain limitations under PTS-DOS.
, TMPEXT
Sets system switch characters ('/' or '-') and temporary file extensions across different DOS versions.
, TRACEBUF
Enables or disables single-step execution of CONFIG.SYS globally or locally with configurable buffer sizes (varies between DOS and OS/2).
(OS/2 3.0+) Records detailed error logs for diagnostic purposes.

UTemplate:NbndZ

Assigns a specific segment to be used as UMB memory by DOS.
Specifies which UMB server is utilized.
Defines address ranges designated as UMB RAM.
Enables or disables verification of disk writes.
Sets the DOS version that is reported to applications.
Configures VGA display status settings.
Determines the current video mode in use.
Controls whether virtual DMA is permitted.
Specifies if Virtual Mode Extensions on the processor should be disabled.
Manages VxD driver configuration for Windows environments.
Sets system support parameters for Windows operation.
Configures relocation settings for the Extended BIOS Data Area (XBDA).
Enables conditional execution on XT-compatible hardware.
Activates built-in Year 2000 compatibility features.
Defines the default affirmative response character in prompts.
Manages tracking of file deletions.

Issues

Although booting without CONFIG.SYS or AUTOEXEC.BAT is possible, these files remain crucial for comprehensive operating system customization and meeting software prerequisites. Any corruption or absence necessitates troubleshooting to restore functionality.

In cases where CONFIG.SYS lacks a SHELL directive or is missing/corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to 6.0 will fail to boot if COMMAND.COM is not found. MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later will prompt users to specify a command processor path if COMMAND.COM is missing, also offering limited runtime shell alternatives without requiring a system reboot.

COMMAND.COM from MS-DOS 7.0 onward is incompatible with DR-DOS. This incompatibility impacts dual-boot configurations where DR-DOS 7.02 and later prevent bypassing SHELL directives during skip, trace, or step modes. Recovery mechanisms include prompting users to enter a valid shell filename before loading COMMAND.COM.

The maximum size allowed for CONFIG.SYS varies among systems: MS-DOS/PC DOS limits it to several kilobytes (up to 64 KB in later versions), whereas DR-DOS imposes no fixed limit aside from file system constraints. MS-DOS processes CONFIG.SYS by compiling it into tokenized memory prior to loading device drivers and TSR programs in a predetermined sequence. In contrast, DR-DOS interprets each directive sequentially as they appear, facilitating precise control over load order and enabling conditional execution based on hardware presence or error conditions.

DR-DOS provides an INSTALL command that integrates non-resident software into the CONFIG.SYS loading sequence, which assists in debugging or resolving conflicts related to loading order.

Limits on SHELL line length also differ: MS-DOS/PC DOS versions 2.0 through 4.01 restrict SHELL lines to 31 characters, later versions allow up to 128 characters, while DR-DOS supports up to 255 characters. It should be noted that CONFIG.SYS directives do not accommodate long filenames.

Dual Booting DOS with Windows 9x

During the installation of Windows 95 on a system already running DOS or an earlier Windows version, the existing CONFIG.SYS and AUTOEXEC.BAT files are renamed to CONFIG.DOS and AUTOEXEC.DOS to enable dual boot functionality between Windows 9x and DOS. When the user selects to boot into DOS, these files are temporarily reverted back to CONFIG.SYS and AUTOEXEC.BAT. Meanwhile, the Windows 95 versions are preserved under the filenames CONFIG.W40 and AUTOEXEC.W40.

In contrast, when Caldera DR-DOS versions 7.02 or 7.03 are installed alongside Windows 95, the original Windows CONFIG.SYS and AUTOEXEC.BAT filenames remain unchanged. DR-DOS instead utilizes alternative startup files named DCONFIG.SYS and AUTODOS7.BAT for its configuration during boot.

OS/2 and Windows NT

OS/2 relies heavily on CONFIG.SYS to set up drivers and environment parameters prior to launching its graphical user interface. However, within the OS/2 compatibility subsystem embedded in Windows NT, these CONFIG.SYS configurations are managed via the system registry rather than through traditional file-based methods.

OS/2 incorporates a variety of undocumented CONFIG.SYS commands that address its intricate configuration requirements.

CONFIG.SYS continues to play a crucial role in OS/2-based operating systems such as eComStation and ArcaOS.

See also

External links

  • Details on AUTOEXEC.BAT and CONFIG.SYS at Computer Hope
  • Overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS directives (archived)
  • Caldera’s CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
  • Guide to FreeDOS CONFIG.SYS directives
  • PTS-DOS 2000 Pro User Manual including CONFIG.SYS instructions (archived)
  • Unofficial German PTS-DOS FAQ (archived) with further CONFIG.SYS information