CHAIN (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Operating systems |
| Founded | 1983 |
| Products | Configuration for DOS and OS/2 startup |
CONFIG.SYS serves as the central configuration file for the DOS and OS/2 operating system families. This plain text file, written in ASCII, contains setup instructions accessible to users that are interpreted by the operating system's DOS BIOS—commonly within IBMBIO.COM or IO.SYS—during system startup. The CONFIG.SYS file was first introduced with DOS version 2.0.
Usage
The directives within CONFIG.SYS configure DOS for hardware devices, software applications, and memory allocation. Once CONFIG.SYS has been processed, DOS initiates the command interpreter defined by the SHELL statement; if none is specified, it defaults to COMMAND.COM, which subsequently executes the AUTOEXEC.BAT script.
Primarily, this file consists of name=value commands that set adjustable parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs) into memory.
Within DOS environments, CONFIG.SYS is located in the root directory of the boot device.
The CONFIG.SYS filename is also employed by (DCP), a variant of MS-DOS developed by East-German manufacturer VEB Robotron.
Certain DOS derivatives allow alternative filenames that override the default CONFIG.SYS:
Advanced iterations of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 utilize CCONFIG.SYS (derived from "Concurrent") instead of CONFIG.SYS. Some Multiuser DOS releases adopt CCONFIG.INI, while REAL/32 uses MCONFIG.SYS. These platforms support supplementary configuration options stored in binary CCONFIG.BIN files, which are typically edited using CONFIG.EXE.
In versions such as DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02+, the filename DCONFIG.SYS (signifying "DR DOS") takes precedence over CONFIG.SYS. This arrangement enabled disk compression configurations where the boot drive letter changes after loading compression drivers and facilitated multi-boot setups.
Both OpenDOS 7.01 and DR-OpenDOS 7.02 check for ODCONFIG.SYS, while some DR-DOS 7.02+ variants look for DRCONFIG.SYS. Since DR DOS 6.0, the command SYS /DR:ext allows modification of default system file extensions to support multiple concurrent boot configurations managed by boot loaders such as LOADER from Multiuser DOS and DR-DOS.
The SHELL directive can specify alternate AUTOEXEC.BAT files using /P[:filename.ext], with COMMAND.COM permitting extensions other than ".BAT" in this mode—a capability also found in 4DOS.
Starting with DR-DOS 6.0, the CHAIN=filespec command enables continuation of configuration processing from another file, which may reside outside the root directory; DR-DOS 7.02+ extends this feature with CHAIN=filespec,label, allowing jumps to specific labels within those files.
With DR-DOS 7.03 and later, executing SYS /A copies matching CONFIG.SYS and AUTOEXEC.BAT files alongside system files.
In other systems, FreeDOS uses FDCONFIG.SYS, RxDOS version 7.24 and above employs RXCONFIG.SYS, and PTS-DOS utilizes CONFIG.PTS.
Both CONFIG.SYS and AUTOEXEC.BAT exist in the root directories of Windows 95 and Windows 98 boot drives but are usually left empty.
Unlike its predecessors, Windows Me does not process CONFIG.SYS during startup; instead, it retrieves environment variables directly from the Windows Registry at:
- HKLM\System\CurrentControlSet\Control\SessionManager\Environment
Under the FlexOS operating system, CONFIG.SYS is a binary file that specifies resource managers and device drivers loaded during boot time.
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>
:;*?!
- Defines labels within CONFIG.SYS that serve as jump points for directives such as , , , and .
- Functions similarly to , but allows inline comments following other CONFIG.SYS commands. Note that under MS-DOS/PC DOS, inline comments are not ignored if enclosed in double quotes.
- Introduces inline comments alongside the ; directive.
- Presents a Yes/No prompt to confirm execution of subsequent CONFIG.SYS commands. While FreeDOS lacks customizable messages, it supports conditional logic with boot menus. Starting with DOS 6.0, a comparable feature is implemented by appending after directives (e.g., ).
- Forces unconditional execution of the next CONFIG.SYS command.
ATemplate:NbndC
- Determines whether programs can be interrupted upon encountering errors.
- Sets which drives record file access timestamps on FAT file systems.
- Enables conditional execution on AT-compatible hardware.
- Boot manager functionality.
- Adjusts the verbosity level of error messages.
- Changes the default serial port driver (from COM1: to COM4:) for the AUX device.
- Restricts access to character devices outside the phantom \DEV directory.
- Loads core device drivers into memory.
- Generates a brief beep even if audible alerts are disabled.
- Specifies the next operating system to boot.
- Enables or disables extended Ctrl+C checking.
- Sets the quantity of disk buffers allocated.
- Similar to BUFFERS but loads buffers into High Memory Area or Upper Memory Blocks.
- , ,
- Configure cache block allocation parameters, time-to-live, and flush intervals.
- Loads programs during CONFIG.SYS processing, pausing until they return control.
- Sets the Caps Lock key state on the keyboard.
- , (PTS-DOS only)
- Defines CD-ROM driver name and buffer count.
- Continues processing CONFIG.SYS from another file or label.
- , , and other PTS-DOS specific directives control system clock type, screen clearing, and more.
- (OS/2 exclusive)
- Defines OEM codepages used by the system.
- , x=1..4 (DR-DOS 7.02+)
- Specifies count, order, I/O addresses, and timeouts for COM ports.
- , (DOS 4.0+, RxDOS)
- Redefines inline comment lead-in characters or skips lines accordingly.
- , (DOS 3.x+)
- Enables internationalization support settings.
- CPU-related commands (CPU88, CPU286, CPU386, CPU486, etc.) allow conditional execution based on CPU type in PTS-DOS and DR-DOS.
DTemplate:NbndF
- Adjusts relocation of drive descriptor tables in memory.
- Defines the segment address limit for multi-sector disk data deblocking operations.
- Activates internal debugger support features.
- Boot manager functionality.
- Loads device drivers into conventional memory.
- Loads device drivers into upper memory areas (equivalent to in DRDOS 5.0).
- Configures country and codepage settings for keyboard, screen, and printer devices.
- Sets cache memory size parameters.
- Selects floppy disk compatibility mode.
- Specifies font used for display output.
- Controls loading DOS into high or upper memory areas (similar to in DRDOS 5.0).
- Loads DOS tables such as BUFFERS, FCBS, FILES, LASTDRIVE, and STACKS into upper memory blocks.
- Specifies an alternative directory path for DOS files.
- Defines search paths for data files utilized by DOS components.
- Describes physical characteristics of disk drives connected to the system.
- Sets parameters for unrecognized or generic drives.
- Refer to for additional details.
- Enables error log creation via PDUMP.nnn and assigns drive location for logs.
- Controls whether messages are displayed on the screen during processing.
- Allows display of messages including ANSI escape sequences.
- Adds extra verification checks when launching programs.
- Specifies an assumed error or return code value during execution.
- Manages A20 gate state settings when starting applications.
- Terminates CONFIG.SYS processing before reaching file end (except SWITCHES and SHELL directives).
- Sets hash table size for accelerated file open operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
- Configures maximum number of cached File Control Blocks open simultaneously (shares buffer space with FILES under DR-DOS).
- Explicitly loads FCBs into upper memory areas.
- Boot manager functionality.
- Defines the maximum number of files that can be open concurrently.
- Loads file handles explicitly into upper memory space.
- Supports inclusion and execution of specified CONFIG.SYS subsections (see IGNORE).
GTemplate:NbndI
- Pauses execution awaiting a key press or timeout, then sets the error level to the ASCII value of the key pressed or 1024 if timed out.
- Resumes processing of CONFIG.SYS at a designated label.
- Continues nested CONFIG.SYS processing at a specified label, returning afterward to the prior point.
- Refer to , , or for additional information.
- Consult for further details.
- See for related usage.
- Refer to or for more context.
- See or for related commands.
- Consult for additional guidance.
- Loads a TSR (Terminate and Stay Resident) program into memory following DOS data segment relocation; compare with INSTCDEX.
- Refer to , , or for related instructions.
- See for more information.
- Consult or regarding usage.
- Activates console and command line history buffers with enhanced pattern search capabilities.
- Defines the address of the High Memory Area (HMA) segment.
- Sets the CPU's halt (HLT) energy-saving mode configuration.
- Enables scanning of the boot sector for viruses during startup.
- Loads installable file system drivers.
- Prevents execution of specified CONFIG.SYS subsections; see also .
- Permits certain applications to operate at ring 2, allowing direct hardware I/O access.
- Incorporates directives from an alternate menu block (can be emulated using GOSUB/RETURN in DR-DOS).
- Controls the Insert mode state of the keyboard.
- Loads a TSR program into memory residency.
- Installs TSR programs into upper memory areas (equivalent to HIINSTALL in DR DOS 5.0).
- Loads TSR after DOS data segment relocation; see also INSTCDEX for comparison.
- Adjusts PIC interrupt priorities to give precedence to a specified IRQ.
KTemplate:NbndM
- Defines the keyboard layout in use.
- Specifies the location of the relocated keyboard buffer in memory.
- Sets the maximum number of accessible drive letters.
- Functions similarly to LASTDRIVE but loads Current Directory Structure (CDS) into upper memory regions.
- Lists search directories for Dynamic Link Libraries (DLLs).
- Handles compatibility settings for legacy software applications.
- Determines the number of file locks allowed simultaneously.
- Configures support for boot logos and startup messages via PTS-DOS boot manager integration.
- Specifies count, sequence, I/O port address, and timeout parameters for the LPT1 parallel port device.
- Applies the same settings as LPT1 but for LPT2 device configuration.
- Mirrors LPT1 parameters for LPT3 device setup.
- Enables and configures LPT4 device with similar options as other LPT ports.
- Sets delay duration before elevating process priority levels.
- Defines strategy for memory allocation management.
- Determines default DOS memory allocation policy.
- Specifies options available within menus.
- Sets color schemes for menus (can be emulated under DR-DOS).
- Designates default menu block selection (emulatable in DR-DOS).
- Defines individual menu blocks (emulatable under DR-DOS).
- Activates multitrack disk operation functionality.
- Continues CONFIG.SYS processing from a new file after loading a device driver and setting the %NEWFILE% environment variable.
NTemplate:NbndQ
- Sets the default character representing No () in Yes/No/Resume prompts.
- Toggles keyboard [[Num Lock|Template:Keypress]] status on or off at startup.
- Executes commands conditionally based on the last error code, e.g., .
- Displays a message and waits for a key press, similar to and commands in DR-DOS environments.
- Requires user confirmation when errors occur during CONFIG.SYS processing.
- Configures buffer sizes allocated to LPT parallel ports.
- Executes commands conditionally on PC-compatible hardware platforms.
- Sets scheduler priority levels for task management.
- Defines priority settings specifically for disk I/O operations programs.
- Changes default printer device driver assignments between LPT1 through LPT3 or LPT4 ports.
- Specifies whether DOS applications are permitted to execute.
- Loads a user interface shell environment at startup.
- Executes commands conditionally on IBM PS/1-compatible systems only.
- Executes commands conditionally on IBM PS/2-compatible systems only.
- Suppresses output directed to STDOUT.
RTemplate:NbndT
- Facilitates automatic system reboot upon encountering errors.
- Permits inclusion of comments within CONFIG.SYS files.
- Allocates a drive letter for local block device drivers.
- Defines the default character for Resume () responses in Yes/No/Resume prompts.
- Returns control from nested CONFIG.SYS processing to the prior GOSUB or SWITCH point, optionally with a return value.
- Specifies the amount of real mode memory available.
- Allows concurrent loading of programs in CONFIG.SYS, functioning similarly to CALL or INSTALL commands in DOS.
- Determines whether the first character of deleted files is stored in the FAT reserved area.
- Sets the video mode in FreeDOS or configures screen access methods under PTS-DOS.
- Controls the status of the keyboard Scroll Lock key, enabling or disabling it.
- Assigns environment variables.
- Loads the command interpreter shell.
- Similar to SHELL but supports a SIZE parameter to pre-allocate COMMAND.COM into HMA or UMBs, minimizing fragmentation.
- Defines keyboard modifier key states such as Shift Lock, Num Lock, and Scroll Lock.
- Specifies whether files close automatically when Ctrl+Alt+Del is pressed.
- Determines if POST is bypassed during reboot.
- Sets the number of hardware interrupt stacks.
- Specifies default stack size for newly created threads.
- Functions like STACKS but loads buffers into upper memory areas.
- Configures boot manager settings.
- Reserved for internal operations.
- Manages XMS A20 gate functionality.
- Defines submenu blocks emulatable in DR-DOS using CLS, ECHO, and SWITCH commands.
- Redirects error logs to disk instead of displaying them on screen popups.
- Indicates path for swap file storage.
- Conditionally continues nested CONFIG.SYS execution at designated labels based on key input, with RETURN resuming previous processing point.
- Sets system-wide default switch character ('/' or '-').
- Specifies various special operational options.
- Activates a workaround for floating-point unit rounding errors.
- Defines an alternative DOS boot filename.
- Configures memory addresses for DOS components.
- Loads system data from an alternate disk location.
- Sets size for dynamic system memory pool allocation.
- Enables loading of DOS data and code into UMBs.
Specifies maximum concurrent thread count.
Defines timeouts for CONFIG.SYS single-step execution and default responses for Yes/No prompts and SWITCH selections. PTS-DOS supports only timeout configuration.
Adjusts minimum and maximum scheduler time slices for thread management.
Specifies file extension used for temporary files.
Globally or locally enables/disables single-step execution of CONFIG.SYS and AUTOEXEC.BAT. OS/2 implementation differs notably from DOS variants.
Defines size of TRACE log buffer storage.
Records comprehensive error details during trap events.
UTemplate:NbndZ
- Instructs DOS to designate a particular segment as an Upper Memory Block (UMB).
- Configures the UMB server parameters.
- Defines address ranges allocated as UMB RAM segments.
- Enables or disables verification of disk writes.
- Reports DOS version information to applications.
- Controls VGA display status settings.
- Specifies the active video mode configuration.
- Enables use of virtual DMA capabilities.
- Manages processor Virtual Mode Extensions (VME) features.
- Configures Virtual Device Drivers (VxD) for Windows environments.
- Sets system support parameters for Windows operation.
- Relocates Extended BIOS Data Area (XBDA) to a new memory location.
- Executes conditionally on XT-compatible hardware platforms.
- Configures built-in support for Year 2000 compliance issues.
- Sets the default character used in Yes prompts.
- Tracks file deletions within the system.
Challenges
Although the system can initiate booting without a valid CONFIG.SYS file, this file—alongside AUTOEXEC.BAT—is indispensable for achieving a complete DOS startup and system customization. These configuration files define essential system parameters and specify required software components, which are vital for a personalized operating environment. Any corruption or damage to these files necessitates diagnostic efforts.
In cases where CONFIG.SYS omits the SHELL directive or is absent/corrupted, DOS attempts to locate COMMAND.COM within the root directory of the boot drive. Earlier DOS versions prior to 6.0 fail to proceed if COMMAND.COM is not found. However, MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 or later versions prompt users to provide the path to a command interpreter, a prompt also triggered when the shell unexpectedly terminates or aborts. This feature enables temporary replacement of the runtime shell without requiring a system reboot.
COMMAND.COM from MS-DOS 7.0 onwards is incompatible with DR-DOS, although it is frequently found in the C: root directory in systems configured for dual-booting. Starting with DR-DOS 7.02, the SHELL directive is strictly enforced during skip, trace, and step modes to maintain system stability by preventing circumvention. Subsequent updates restored some skip functionality to allow recovery from invalid shell arguments. If no SHELL directive exists when CONFIG.SYS processing is skipped, users are prompted to input a valid shell filename before COMMAND.COM loads.
Limits on CONFIG.SYS file size differ between systems: MS-DOS and PC DOS restrict it to several kilobytes (with recent versions allowing up to 64 KB), whereas DR-DOS imposes no significant size constraints since it processes lines sequentially without tokenizing or sorting them. This method provides users with granular control over the loading sequence of drivers and TSRs through DEVICE and INSTALL commands, facilitating conflict management and conditional execution based on hardware presence or error conditions—an essential capability for advanced customization and troubleshooting.
For MS-DOS/PC DOS versions 2.0 through 4.01, the maximum length of the SHELL directive line was capped at 31 characters, which was extended up to 128 characters in later releases; DR-DOS supports lines up to 255 characters in length. Notably, CONFIG.SYS directives do not support long filenames.
Dual Booting DOS with Windows 9x
When Windows 95 is installed over an existing DOS or Windows environment, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed CONFIG.DOS and AUTOEXEC.DOS respectively, enabling dual-boot functionality between Windows 9x and DOS. Upon booting into DOS mode, these backup files are temporarily restored as CONFIG.SYS and AUTOEXEC.BAT. Additionally, Windows 95 system files are backed up under the names CONFIG.W40 and AUTOEXEC.W40.
In contrast, installing Caldera DR-DOS versions 7.02 or 7.03 alongside Windows 95 leaves Windows’ CONFIG.SYS and AUTOEXEC.BAT untouched. Instead, DR-DOS employs its own startup files named DCONFIG.SYS and AUTODOS7.BAT.
OS/2 / Windows NT
OS/2 depends extensively on CONFIG.SYS for setting up device drivers and environmental parameters prior to launching its graphical user interface.
Within the OS/2 subsystem of Windows NT, CONFIG.SYS is presented as such to OS/2 applications but is actually maintained within the system registry.
There exist several undocumented CONFIG.SYS directives specific to OS/2.
CONFIG.SYS continues to be utilized by OS/2 derivatives such as eComStation and ArcaOS.
See also
- IBMBIO.COM / IO.SYS
- IBMDOS.COM / MSDOS.SYS
- CONFIG (environment variable)
- AUTOEXEC.BAT
- COMMAND.COM
- List of DOS commands
External links
- Information on AUTOEXEC.BAT and CONFIG.SYS available at Computer Hope
- Overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS commands (archived)
- Caldera’s CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
- Details on FreeDOS CONFIG.SYS commands
- PTS-DOS 2000 Pro User Guide featuring CONFIG.SYS commands (archived)
- Unofficial German PTS-DOS FAQ with extended CONFIG.SYS command listings (archived)