Jump to content

INCLUDE (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article INCLUDE (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983
ProductsConfiguration commands for DOS and OS/2 boot sequence

CONFIG.SYS serves as the chief 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) interprets during the boot sequence. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are responsible for setting up DOS to manage devices, applications, and memory allocation. Once CONFIG.SYS has been processed, DOS launches the command interpreter specified on the SHELL line; if none is specified, it defaults to COMMAND.COM, which then executes AUTOEXEC.BAT.

Typically, the file contains name=value pairs that establish configurable settings or load essential components such as device drivers and terminate-and-stay-resident programs (TSRs) into system memory. CONFIG.SYS is located in the root directory of the system’s boot drive.

Certain DOS variants check for alternative configuration filenames that take precedence over CONFIG.SYS. For instance, advanced versions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 prioritize CCONFIG.SYS or CCONFIG.INI, which allow for expanded configuration options stored in a binary file (CCONFIG.BIN) that can be edited using CONFIG.EXE.

In the case of DR DOS 3.31 and later releases—including PalmDOS, Novell DOS, and DR-DOS 7.02+—the DCONFIG.SYS file overrides CONFIG.SYS. This capability facilitates disk compression and supports multi-boot setups by enabling multiple configuration files to coexist. Similarly, OpenDOS 7.01 also searches for ODCONFIG.SYS or DRCONFIG.SYS. Starting with DR-DOS 6.0, users can customize configuration file extensions through SYS /DR:ext, allowing parallel system files to operate simultaneously under boot managers like LOADER.

Additional enhanced features include SHELL parameters that specify alternative AUTOEXEC.BAT files, as well as the CHAIN=filespec[,label] directive, which enables continuation of configuration processing in other files—even those located outside the root directory.

In other operating systems, FreeDOS uses FDCONFIG.SYS, while RxDOS and PTS-DOS utilize RXCONFIG.SYS and CONFIG.PTS, respectively.

Although Windows 95 and 98 maintain CONFIG.SYS and AUTOEXEC.BAT on their boot drives, these files are generally empty by default. Windows Me does not execute CONFIG.SYS at all; instead, it retrieves environment variable settings directly from the Windows Registry.

Under the FlexOS platform, CONFIG.SYS is implemented as a binary file that defines resource managers and device drivers loaded during system startup.

Example

A sample CONFIG.SYS for MS-DOS 5 might look like this: <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 that serve as jump points for , , , , and commands.
Functions similarly to , but can also provide in-line comments following other directives. (Note that in MS-DOS/PC DOS, inline comments inside double quotes are not ignored.)
Used to begin in-line comments alongside the ; directive.
Prompts with a Yes/No question before executing subsequent directives. (FreeDOS does not support optional messages but offers conditional boot menus.) Starting with DOS 6.0+, a comparable feature exists by appending after directives.
Executes the subsequent directive without any condition.

ATemplate:NbndC

Determines whether programs can be interrupted upon encountering errors.
Sets which drives maintain file access timestamps within FAT file systems.
Enables conditional execution tailored for AT-compatible hardware.
Manages boot loading processes.
Adjusts the verbosity level of error messages.
Changes the default serial port driver for the AUX device (from COM1: through COM4:).
Prevents use of character devices outside the virtual \DEV directory.
Loads the fundamental device driver into system memory.
Produces a beep even if sound notifications are disabled.
Selects the operating system to boot next.
Enables or disables extended Ctrl+C interrupt checks.
Sets the quantity of disk buffers allocated by the system.
Similar to BUFFERS but loads buffers into High Memory Area (HMA) or Upper Memory Blocks (UMBs).
, ,
Parameters for managing cache allocation and flushing within system pools.
Loads specified programs during CONFIG.SYS processing and pauses until they return control.
Defines initial Caps Lock status on keyboard at startup.
,
Names CD-ROM hardware drivers and sets buffer counts.
Continues processing of CONFIG.SYS commands from a different file or section label.
, , , and other instructions configure system clock type, screen clearing behavior, OEM code pages, among other settings, mainly applicable to OS/2 and PTS-DOS environments.
, ...,
Configure serial COM port parameters including I/O addresses, timeouts, and logical ordering.

Additional directives influence system operations such as DMA buffer allocation (COMAREA), inline comment syntax (COMMENT), internationalization support (COUNTRY), cursor positioning (CPOS), CPU-specific conditional execution (CPU88, CPU386, CPU486+), and more—primarily designed for specialized DOS variants like PTS-DOS and Embedded DOS.

This comprehensive set of CONFIG.SYS directives allows for fine-tuned system customization aimed at enhancing performance and ensuring hardware compatibility across multiple DOS platforms, which is particularly useful for organizations maintaining legacy or embedded systems.

DTemplate:NbndF

Controls relocation of drive descriptor tables in memory.
Defines the memory segment limit up to which multi-sector disk data deblocking is permitted.
Activates built-in debugger support.
Boot manager configuration directive.
Loads a device driver into conventional memory.
Loads a device driver into upper memory area, similar to in DRDOS 5.0.
Sets country and codepage information for keyboard, screen, and printer devices.
Configures sizes for cache memory segments.
Specifies floppy disk compatibility modes.
Determines the font used for display output.
Controls loading of DOS into high memory area and/or use of upper memory blocks, akin to in DRDOS 5.0.
Loads DOS tables (, , , etc.) into upper memory regions.
Specifies an alternative directory path for DOS system files.
Sets search paths for data files used by the system.
Defines physical characteristics of disk drives connected to the system.
Establishes parameters for drives not otherwise recognized by the OS.
See .
Enables logging of error dumps to a specified drive using PDUMP.nnn files.
Outputs a simple message on the display screen.
Displays messages that include ANSI escape sequences for formatting.
Indicates whether extra validation should occur when launching programs.
Specifies an assumed error or return code following program execution.
Defines the state of the A20 address line when starting a program.
Terminates CONFIG.SYS processing before reaching file end, with exceptions for certain directives.
Sets hash table size to optimize file open operations, differing from MS-DOS/PC DOS external drivers.
Specifies the number of cached File Control Blocks (FCBs) that can be opened simultaneously (shares buffer space with FILES under DR-DOS).
Functions like FCBS but loads FCBs into upper memory areas.
Boot manager directive variant.
Indicates maximum number of files that can be open concurrently.
Similar to FILES but loads file handles into upper memory blocks.
Executes specified subsections within CONFIG.SYS files (see IGNORE).

GTemplate:NbndI

Waits for a key press or timeout, setting the error level to the ASCII value of the key or 1024 if timed out.
Resumes CONFIG.SYS processing at the designated label.
Continues nested CONFIG.SYS processing at a specified label, returning to the prior point afterward.
Refer to , , or for further details.
Consult for additional information.
See for related commands.
Refer to or for more context.
See or for further explanation.
Consult for relevant details.
Loads a TSR program into memory similarly to , but performs this after relocating the DOS data segment. Compare with INSTCDEX.
See , , or for related functions.
Refer to for additional commands.
See or for more information.
Activates console and command line history buffer, including advanced pattern searching capabilities.
Defines the HMA segment address.
Sets energy-saving mode via HLT configuration.
Determines whether the system checks for boot sector viruses.
Loads installable file systems into the environment.
Prevents execution of specified CONFIG.SYS subsections.
Permits certain applications to operate at ring 2, granting direct hardware I/O access.
Incorporates directives from another menu block, emulated by GOSUB/RETURN in DR-DOS.
Sets the keyboard’s Insert mode status.
Installs a TSR program into memory.
Loads a TSR into upper memory areas (equivalent to HIINSTALL in DR DOS 5.0).
Installs a TSR program post-DOS data segment relocation, similar to INSTALL. Compare with INSTCDEX.
Adjusts PIC interrupt priorities to assign highest priority to a specified IRQ number.

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 areas.
Establishes search paths for DLL files.
Manages legacy program compatibility settings.
Specifies the number of allowable file locks.
Configures display of boot logos when using PTS-DOS boot manager.
Defines count, logical sequence, I/O address, and timeout parameters for LPT1 device.
Applies similar configuration settings to LPT2 device.
Configures LPT3 device with analogous parameters.
Enables and sets up LPT4 device functionality.
Sets delay time before process priority is increased.
Configures strategies for memory allocation management.
Specifies default DOS memory allocation method.
Defines menu options available within the system.
Sets menu color schemes (can be emulated under DR-DOS).
Specifies default menu block (emulation supported in DR-DOS).
Defines individual menu blocks (emulatable under DR-DOS).
Enables operations involving multitrack disks.
Continues CONFIG.SYS processing from a new file, optionally after loading a specific driver and setting the %NEWFILE% environment variable.

NTemplate:NbndQ

Sets the default character used as No () in Yes/No/Resume prompts.
Controls the status of keyboard [[Num Lock|Template:Keypress]] key.
Executes commands conditionally based on the last error code (e.g., ).
Displays text and waits for key input, similar to and commands in DR-DOS environments.
Requires user confirmation for errors encountered during CONFIG.SYS processing.
Defines buffer sizes allocated for LPT ports.
Enables conditional execution on PC-compatible systems only.
Configures scheduling priority settings within the system.
Sets priority levels specifically for disk I/O operations programs.
Changes the default printer device driver among LPT1 through LPT4 ports.
Specifies whether DOS programs are permitted to run on the system.
Loads a user interface shell environment.
Enables conditional execution on IBM PS/1-compatible machines only.
Enables conditional execution on IBM PS/2-compatible machines exclusively.
Suppresses display output sent to STDOUT.

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS.
Allocates a drive letter for local block device drivers.
Defines the default Resume () character used in prompts.
Enables returning from nested CONFIG.SYS processing after GOSUB or SWITCH commands, optionally providing a return code.
Specifies the amount of real mode memory available.
Allows concurrent loading of programs in CONFIG.SYS, functioning similarly to CALL or INSTALL commands.
Indicates that the first character of deleted files is stored in the FAT reserved area.
Determines video mode settings (FreeDOS) or methods for screen access (PTS-DOS).
Manages the keyboard’s Scroll Lock state.
Establishes environment variables.
Loads the command interpreter shell.
Functions like SHELL but includes a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMBs, optimizing memory usage with third-party shells.
Sets keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Controls whether files close upon pressing Ctrl+Alt+Del.
Skips the Power-On Self Test (POST) during reboot.
, STACKSIZE, STACKSHIGH
Configure interrupt stack sizes and buffer locations across multiple DOS variants to enhance system stability and optimize memory allocation.
, SYSBOOT, SYSGEN, SYSLOAD
Specific to PTS-DOS, these directives handle boot configuration, system loading addresses, and alternative operating system booting options to allow flexible setup.
, SWITCH, SWITCHES
Facilitate conditional processing within CONFIG.SYS by enabling submenu blocks or key-dependent branching to customize startup behavior depending on DOS version.
, SWAPPATH
OS/2 directives that specify swap file locations and enable discreet error logging to improve system reliability and performance management.
, TIMEOUT, TRACE
Configure system parameters such as the default switch character ('/' or '-'), prompt timeouts, and single-step execution control in CONFIG.SYS or AUTOEXEC.BAT to improve automation and error handling.
Additional directives like TMPEXT (temporary file extensions), THREADS (concurrent thread support), TIMESLICE (scheduler time slices), and TRAPDUMP (error logging) provide enhanced system control and diagnostic capabilities across various DOS platforms.


UTemplate:NbndZ

Assigns a designated segment for use as an Upper Memory Block (UMB).
Specifies the UMB server configuration.
Defines address ranges allocated for UMB RAM.
Enables or disables verification of disk writes.
Reports a specific DOS version number to applications.
Configures VGA display status settings.
Sets the current video mode comparable to FreeDOS’s SCREEN directive.
Activates virtual DMA functionality.
Controls processor Virtual Mode Extensions (VME).
Configures Windows VxD driver parameters.
Enables support for Windows operating environments.
Adjusts relocation of the Extended BIOS Data Area.
Executes conditionally on XT-compatible systems.
Configures built-in Year 2000 compliance features.
Establishes the default Yes character used in prompts.
Tracks file deletion operations.

Issues

Although it is possible for the system to start without CONFIG.SYS or AUTOEXEC.BAT files, these configurations are essential for comprehensive OS customization and specifying necessary software components. Troubleshooting is required if these files become corrupted or damaged.

When 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 if it cannot be found, whereas MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later will prompt users to specify a command interpreter path. This prompt also appears if COMMAND.COM terminates unexpectedly or exits early, offering a limited runtime shell replacement without requiring a reboot.

Due to incompatibilities between MS-DOS 7.0+ COMMAND.COM and DR-DOS, versions of DR-DOS starting from 7.02 restrict bypassing SHELL directives during skip/trace/step modes (activated via Ctrl+F5/F7/F8). Some DR-DOS releases restore previous skip behavior using Ctrl+F6 to recover from invalid SHELL arguments. If no valid SHELL is found when skipping CONFIG.SYS processing, users must provide an appropriate shell before COMMAND.COM loads.

CONFIG.SYS file size limitations differ: MS-DOS/PC DOS restricts size to a few kilobytes (up to around 64 KB in later editions), while DR-DOS imposes no inherent limit aside from file system constraints. MS-DOS compiles CONFIG.SYS into tokenized form loaded into memory and processes directives sequentially—device drivers precede TSRs. Conversely, DR-DOS interprets CONFIG.SYS line-by-line allowing precise control over driver and TSR loading order via DEVICE and INSTALL commands. This approach facilitates resolving conflicts during loading and supports dynamic integration of non-resident software.

The maximum length of SHELL command lines expanded from 31 characters in MS-DOS/PC DOS versions 2.0 through 4.01 up to as much as 128 characters in later releases. DR-DOS supports lengths up to 255 characters. Note that CONFIG.SYS directives do not accept long filenames.

Dual Booting DOS and Windows 9x

When Windows 95 is installed over a pre-existing DOS or Windows environment, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS, enabling dual boot functionality between Windows 9x and DOS. During a DOS startup, these files are temporarily reverted to their original filenames. Additionally, Windows 95 versions are saved as CONFIG.W40 and AUTOEXEC.W40.

For setups involving Caldera DR-DOS versions 7.02 or 7.03 alongside Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT files remain unchanged, while DR-DOS employs DCONFIG.SYS and AUTODOS7.BAT to manage its boot configuration.

OS/2 / Windows NT

OS/2 makes extensive use of CONFIG.SYS to handle system settings, driver loading, and environment initialization prior to launching the graphical user interface.

Within the OS/2 subsystem of Windows NT, CONFIG.SYS appears under that name to OS/2 applications but is actually maintained within the registry. OS/2 utilizes numerous CONFIG.SYS commands that are not publicly documented.

CONFIG.SYS continues to be supported by OS/2-based operating systems such as eComStation and ArcaOS.

See also

External links

  • Information 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
  • FreeDOS CONFIG.SYS directive descriptions
  • PTS-DOS 2000 Pro User Guide including CONFIG.SYS directive details
  • Unofficial German PTS-DOS FAQ (archived) covering CONFIG.SYS directives