Jump to content

? (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article ? (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 20253 sources
CONFIG.SYS
Company typeConfiguration file
IndustryOperating systems
Founded1983
ProductsConfiguration commands for DOS and OS/2 startup

CONFIG.SYS serves as the central configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, holds configuration commands that the operating system's DOS BIOS (commonly found in IBMBIO.COM or IO.SYS) reads during the startup process. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are used to set up DOS for hardware devices, software applications, and memory management. Once these instructions are executed, DOS launches the command interpreter specified by the SHELL command; if none is specified, it defaults to COMMAND.COM, which then executes the AUTOEXEC.BAT script.

CONFIG.SYS primarily contains name=value pairs that configure adjustable parameters or load essential files such as device drivers and terminate-and-stay-resident programs (TSRs). This file is located in the root directory of the bootable drive.

The same filename is also utilized by (DCP), an MS-DOS variant developed by East-German company VEB Robotron.

Certain DOS variants check for alternative filenames that override CONFIG.SYS:

Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 prioritize CCONFIG.SYS or CCONFIG.INI (in Multiuser DOS) instead of CONFIG.SYS. REAL/32 may additionally support MCONFIG.SYS. These platforms allow extended configuration options stored in binary files like CCONFIG.BIN, which are generally edited using CONFIG.EXE.

In DR DOS versions 3.31 and newer (including PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, DR-DOS 7.02+), DCONFIG.SYS takes precedence over CONFIG.SYS to enable disk compression and multi-boot setups. OpenDOS 7.01 and DR-OpenDOS 7.02 also recognize ODCONFIG.SYS, while some DR-DOS 7.02+ editions look for DRCONFIG.SYS.

Starting with DR-DOS 6.0+, users can modify default file extensions using SYS /DR:ext, allowing multiple system configuration files to coexist in a single root directory and be selected by boot loaders such as LOADER. The SHELL directive supports specifying alternative AUTOEXEC.BAT scripts via /P[:filename.ext], and COMMAND.COM can execute files with non-.BAT extensions in this mode—capabilities also offered by 4DOS. Furthermore, the CHAIN=filespec command permits continuation of processing from another configuration file, optionally with a label parameter in DR-DOS 7.02+.

From version 7.03 onward, DR-DOS adds SYS /A, which copies matching CONFIG.SYS and AUTOEXEC.BAT files alongside system files.

Similar configuration files include FDCONFIG.SYS for FreeDOS, RXCONFIG.SYS for RxDOS, and CONFIG.PTS for PTS-DOS.

In Windows 95 and Windows 98 environments, both CONFIG.SYS and AUTOEXEC.BAT exist in the boot drive's root but are frequently left empty. Windows Me does not process CONFIG.SYS during startup; instead, it loads environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

Within the FlexOS operating system, CONFIG.SYS is a binary file that specifies resource managers and device drivers loaded at boot time.

Example

A sample CONFIG.SYS file 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 to serve as jump destinations for commands such as , , , and .
Functions similarly to , but also permits in-line comments following other directives. (Note: In MS-DOS/PC DOS, inline comments enclosed in double quotes are not disregarded.)
Introduces in-line comments, akin to the ; directive.
Prompts a Yes/No confirmation with an optional message before executing subsequent CONFIG.SYS commands.[1] FreeDOS does not support optional messages but allows conditional execution via boot menus using and . DOS versions 6.0 and above provide a comparable feature by appending after directives (e.g., ).
Executes the next directive without any conditions.

ATemplate:NbndC

Determines whether programs may be interrupted upon encountering errors.
Sets which drives record file access timestamps within FAT file systems.
Executes commands conditionally on AT-compatible hardware.
Acts as a boot manager.
Adjusts the verbosity level of 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 a base device driver into memory.
Produces an audible beep even if sound notifications are disabled.
Defines the operating system to boot next.
Enables or disables extended Ctrl+C interrupt checking.
Specifies how many disk buffers should be allocated.
Similar to BUFFERS but places buffers into High Memory Area (HMA) or Upper Memory Blocks (UMB).
, ,
Manage cache block allocation, retention duration, and flushing behavior.
Loads programs within CONFIG.SYS, running them in the foreground and halting further processing until completion.
Sets the Caps Lock key status on the keyboard.
,
Configures CD-ROM hardware driver names and buffer quantities.
Continues processing of CONFIG.SYS in a new file or label.
, , and others adjust system display settings and behavior specific to PTS-DOS and DR-DOS variants.
, , and related directives enable internationalization support and codepage settings for MS-DOS and OS/2 systems.
Define serial port parameters (applicable from DR-DOS version 7.02 onwards).

Additional directives control hardware configurations, conditional execution based on CPU type (e.g., CPU386), buffer allocation, error handling, and device drivers aimed at optimizing performance across various DOS flavors and OS/2 platforms.

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Specifies the memory segment address used for multi-sector disk data deblocking.
Activates internal debugger support.
Functions 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 codes and codepages for keyboard, screen, and printer devices.
Sets cache memory sizes for improved performance.
Defines floppy disk compatibility modes.
Selects display fonts.
Specifies loading DOS into high memory and/or usage of upper memory blocks.
Loads DOS internal tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory.
Specifies an alternative directory path for DOS system files.
Defines search paths for data files.
Sets physical parameters for disk drives.
Establishes parameters for unknown or unrecognized drives.
See .
Enables error log creation with PDUMP.nnn files on a specified drive.
Displays a standard message on screen.
Shows messages including ANSI escape sequences for enhanced formatting.
Performs additional verification when launching programs.
Assigns an error or return code to be assumed next in sequence.
Controls A20 gate state when starting applications.
Terminates CONFIG.SYS processing prematurely except for SWITCHES and SHELL commands.
Defines hash table size used for accelerating file open operations (differs from MS-DOS/PC DOS FASTOPEN).
Specifies how many File Control Blocks can be cached simultaneously (shares buffer space with FILES in DR-DOS).
Similar to FCBS but loads these into upper memory areas.
Acts as a boot manager utility.
Sets the number of files that can be opened at once.
Equivalent to FILES but loads file handles into upper memory blocks.
Includes execution of designated CONFIG.SYS subsections (refer to IGNORE).

GTemplate:NbndI

Waits for a key press or times out, assigning the error level to the ASCII value of the key or 1024 if timed out.
Resumes processing of CONFIG.SYS at a designated label.
Continues nested CONFIG.SYS processing at a specified label, then returns to the prior point.
Refer to , , or for additional details.
See also .
Consult .
Refer to or for further information.
See or as applicable.
Consult .
Loads a TSR program into memory following relocation of DOS data segment. See also INSTCDEX.
Refer to , , or for more context.
Consult .
See or for related commands.
Activates console and command line history buffer with enhanced pattern matching capabilities.
Defines the address of the High Memory Area (HMA) segment.
Configures CPU HLT (halt) power-saving mode.
Enables scanning of the boot sector for viruses.
Loads installable file system drivers.
Prevents execution of specific CONFIG.SYS subsections.
Permits designated programs to execute at CPU ring 2, allowing direct hardware I/O access.
Includes directives from another menu section (emulated using GOSUB/RETURN in DR-DOS).
Sets the keyboard's Insert mode state.
Installs a TSR program into memory.
Loads TSR programs into upper memory areas (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSR after relocating the DOS data segment. See also INSTCDEX.
Adjusts PIC interrupt priorities to favor a specified IRQ number.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the location of the relocated keyboard buffer in memory.
Sets the maximum number of accessible drives.
Similar to LASTDRIVE but loads Current Directory Structure (CDS) into upper memory instead.
Lists directories searched for dynamic link libraries (DLLs).
Controls compatibility handling for legacy software.
Configures the maximum number of file locks allowed.
Enables boot logo functionality and startup messages when used with PTS-DOS boot manager.
Specifies count, logical sequence, I/O port address, and timeout values for LPT1 device.[2]
Provides equivalent settings for LPT2.[2]
Configures similar parameters for LPT3.[2]
Enables and sets configuration options for LPT4 device.
Sets delay duration before increasing process priority level.
Defines the strategy used for memory allocation management.
Specifies default memory allocation behavior within DOS.
Declares menu options available to users.
Sets color schemes for menus (can be emulated under DR-DOS).
Determines default menu block selection (emulatable in DR-DOS).
Defines individual menu blocks (emulatable under DR-DOS).
Enables support for multitrack disk operations.
Continues CONFIG.SYS processing from an external file, optionally loading a device driver and setting %NEWFILE% environment variable.[3]

NTemplate:NbndQ

Specifies the default character interpreted as No () in Yes/No/Resume prompts.
Sets initial status of keyboard [[Num Lock|Template:Keypress]] key—enabled or disabled.
Enables conditional execution based on previous error codes, such as .
Displays a message and waits for user key input similarly to DR-DOS commands and .
Requires user confirmation upon encountering errors during CONFIG.SYS processing.
Configures buffer sizes assigned to LPT ports.
Enables conditional execution depending on PC-compatible hardware detection.
Sets process scheduling priority levels.
Adjusts priority specifically for disk input/output operations.
; Changes default printer device driver assignment among LPT1 through LPT4 ports.
; Controls permission for running DOS applications.
; Loads a user interface shell program.
; Allows conditional execution on IBM PS/1-compatible systems.
; Allows conditional execution on IBM PS/2-compatible systems.
; Suppresses output sent to standard output (STDOUT).

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS (ignored by PTS-DOS).
Allocates a drive letter to local block storage devices.
Sets the default Resume () character displayed in command prompts.
Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH point, optionally providing a return code.
Specifies the size of real mode memory available.
Enables simultaneous loading of programs in CONFIG.SYS running in the background.
Determines whether the first character of deleted files is stored within the FAT reserved section.
Defines video display mode under FreeDOS or sets screen access methods for PTS-DOS.
Controls keyboard Scroll Lock status, turning it on or off.
Manages environment variable settings.
Loads the command interpreter shell.
Similar to SHELL but allows pre-allocation of memory for COMMAND.COM to load into HMA or UMBs, enhancing memory efficiency when using third-party shells.
Specifies keyboard modifier key states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines file closing behavior triggered by Ctrl+Alt+Del.
Indicates whether the Power-On Self-Test (POST) is bypassed during reboot.
, STACKSIZE, STACKSHIGH
Define hardware interrupt stack sizes and buffer locations with varying levels of support across DOS versions and compatibility considerations.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
Commands specific to PTS-DOS that manage boot configurations, system memory allocation, and loading mechanisms to enhance system performance.
, SWITCHES
Facilitate menu creation and special option settings primarily available in DOS 6.0 and later versions (with limited functionality in DR-DOS and FreeDOS).
, SWAPPATH, THREADS, TIMESLICE
OS/2-exclusive commands that control error logging paths, swap file directories, thread concurrency, and scheduler time slices for improved system management.
, SWITCHAR
Enables conditional processing within CONFIG.SYS based on key input and defines the default switch character ('/' or '-') for commands, improving script adaptability across DOS platforms.
, TRACE, TRACEBUF
Oversee CONFIG.SYS execution timing, enable step-by-step debugging modes, and configure log buffer sizes to assist with diagnostics in DR-DOS, PTS-DOS, FreeDOS, and OS/2 systems.
, TRAPDUMP
PTS-DOS-specific configurations for temporary file extensions and detailed error logging to support enhanced system monitoring.

UTemplate:NbndZ

Designates a particular memory segment for use as Upper Memory Blocks (UMB).
Specifies which UMB server is utilized by DOS.
Defines address ranges allocated as UMB RAM areas.
Enables or disables verification of disk write operations.
Sets the DOS version number reported to applications.
Configures VGA display status parameters.
Indicates current video mode settings similar to FreeDOS's SCREEN command.
Controls whether virtual DMA functionality is permitted.
Manages processor Virtual Mode Extensions (VME) settings.
Configures VxD driver parameters for Windows environments.
Adjusts system support options related to Windows operation.
Controls relocation of the Extended BIOS Data Area (XBDA).
Executes conditionally on XT-compatible hardware platforms.
Enables built-in Year 2000 (Y2K) compliance support features.
Defines the default affirmative response character in prompts.
Sets parameters for tracking file deletions.

Issues

Although the system is capable of booting without CONFIG.SYS or AUTOEXEC.BAT, these configuration files are crucial for comprehensive operating system customization and meeting software prerequisites. When these files become corrupted or damaged, diagnostic efforts are required.

In the absence of a SHELL directive within CONFIG.SYS—or if the file is missing or compromised—DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to MS-DOS 6.0 will fail to boot if COMMAND.COM is not found, whereas later releases provide a prompt requesting the path to a command processor. This recovery prompt also appears if the main shell terminates unexpectedly, allowing users to substitute a shell at runtime without needing to reboot.

Due to incompatibilities between MS-DOS 7.0 and later versions of COMMAND.COM and DR-DOS, versions 7.02 and above of DR-DOS prevent bypassing SHELL directives when operating in skip, trace, or step modes. Instead, users must specify a valid shell before COMMAND.COM is loaded from the root directory. This measure improves system reliability during boot recovery scenarios.

The size of CONFIG.SYS under MS-DOS and PC DOS is limited to a few kilobytes (up to 64 KB in more recent editions), whereas DR-DOS imposes no fixed size constraint aside from limitations imposed by the file system itself. MS-DOS processes CONFIG.SYS by tokenizing its contents and handling directives in a predetermined sequence—loading drivers before TSRs. In contrast, DR-DOS interprets CONFIG.SYS line-by-line, granting precise control over the order in which device drivers and TSRs load through DEVICE and INSTALL commands. This approach facilitates resolving conflicts during loading and incorporating temporary utilities into the boot procedure.

For MS-DOS/PC DOS versions 2.0 through 4.01, the maximum length for a SHELL command line is restricted to 31 characters; subsequent versions allow up to 128 characters, while DR-DOS supports command lines as long as 255 characters. It is important to note that CONFIG.SYS directives do not accept long filenames.

Dual booting DOS and Windows 9x

When installing Windows 95 on top of an existing DOS or Windows environment, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed CONFIG.DOS and AUTOEXEC.DOS respectively. This renaming facilitates dual-boot functionality between Windows 9x and DOS modes. Upon booting into DOS, these backup files are temporarily restored as CONFIG.SYS and AUTOEXEC.BAT. Meanwhile, Windows 95 retains its own copies under the names CONFIG.W40 and AUTOEXEC.W40.

In setups where Caldera DR-DOS 7.02 or 7.03 coexists with Windows 95, Windows’ original CONFIG.SYS and AUTOEXEC.BAT remain intact. Instead, DR-DOS utilizes separate startup configurations named DCONFIG.SYS and AUTODOS7.BAT.

OS/2 / Windows NT

OS/2 depends extensively on CONFIG.SYS for driver configuration and environment setup prior to launching its graphical user interface.

Within the OS/2 subsystem embedded in Windows NT, CONFIG.SYS was presented virtually to OS/2 applications but was actually maintained within the Windows registry.

Numerous CONFIG.SYS directives employed by OS/2 lack formal documentation.

CONFIG.SYS remains in active use among OS/2 successors such as eComStation and ArcaOS.

See also

External links

  • AUTOEXEC.BAT and CONFIG.SYS details 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
  • FreeDOS documentation on CONFIG.SYS directives
  • PTS-DOS 2000 Pro User Manual including directive explanations
  • Unofficial German PTS-DOS FAQ (archived), containing additional CONFIG.SYS information
  1. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Paul_2000_CONFIG
  2. ↑ 2.0 2.1 2.2 Cite error: Invalid <ref> tag; no text was provided for refs named Paul_1997_OD-A3
  3. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Datalight_2005_ROM-DOS