EXECA20OFF (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Computer operating systems |
| Founded | 1983 |
| Products | System configuration directives for DOS and OS/2 |
CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This specialized ASCII text document contains setup instructions that the operating system's DOS BIOS—usually 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 configuring DOS to support hardware devices, applications, and memory management tools. Once CONFIG.SYS is processed, DOS initiates the command interpreter specified on the SHELL line; if none is designated, it defaults to COMMAND.COM. Subsequently, the shell executes commands from the AUTOEXEC.BAT file.
This file primarily consists of name=value statements that set configurable parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs) into memory.
In DOS environments, CONFIG.SYS 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 manufacturer VEB Robotron.
Certain DOS derivatives recognize alternative filenames that supersede CONFIG.SYS:
Early releases of Concurrent DOS versions 3.2 through 4.1 did not support CONFIG.SYS; however, later editions—including Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32—employ CCONFIG.SYS (with "C" referring to "Concurrent"). Some Multiuser DOS iterations use CCONFIG.INI, while REAL/32 seeks out MCONFIG.SYS. These platforms allow extended configuration options stored in binary files like CCONFIG.BIN, which are typically edited using CONFIG.EXE.
For DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, and DR-DOS versions 7.02 and later, DCONFIG.SYS (where "D" stands for "DR DOS") takes precedence over CONFIG.SYS. Originally associated with disk compression utilities to handle drive letter reassignments, this file also supports multi-boot setups.
OpenDOS 7.01 and DR-OpenDOS 7.02 look for ODCONFIG.SYS, while certain DR-DOS 7.02+ variants check for DRCONFIG.SYS. Since DR DOS 6.0, the command SYS /DR:ext enables modification of default system file extensions, allowing multiple sets of system files to coexist within a single root directory and be selected through boot loaders such as LOADER used in Multiuser DOS and DR-DOS 7.02/7.03.
The SHELL directive can specify alternate AUTOEXEC.BAT files via /P[:filename.ext], with COMMAND.COM permitting extensions other than .BAT in this context—a feature also supported by 4DOS. From DR-DOS 6.0 onward, CHAIN=filespec allows continuation of configuration processing from another file anywhere on the boot drive; DR-DOS 7.02+ enhances this with an optional label argument (CHAIN=filespec,label) to jump to specific sections within that file.
Starting with DR-DOS 7.03, the command SYS /A copies CONFIG.SYS and AUTOEXEC.BAT alongside other system files.
Similar functionality exists 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 are present in the root directories of Windows 95 and Windows 98 boot drives due to their DOS heritage but typically contain no content.
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
In contrast, under FlexOS, CONFIG.SYS exists as a binary file that specifies resource managers and device drivers loaded at system initialization.
Example
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 in CONFIG.SYS to serve as jump targets for , , , , and commands.
- Functions similarly to , but also supports inline comments following other CONFIG.SYS instructions. (Note: In MS-DOS/PC DOS, inline comments inside double quotes are not disregarded.)
- Used at the start of inline comments, complementing the ; directive.
- Prompts a Yes/No confirmation with an optional message before executing subsequent CONFIG.SYS commands. FreeDOS allows conditional execution with boot menus via and . DOS version 6.0 and later supports a comparable feature by appending a after directives (e.g., ). DR DOS includes support for this variant as well.
- Forces unconditional execution of the next CONFIG.SYS command.
ATemplate:NbndC
- Determines whether programs can be interrupted upon errors.
- Specifies which drives record file access timestamps in FAT file systems.
- Enables conditional execution on AT-compatible hardware.
- Boot manager functionality.
- Adjusts the verbosity level of error messages.
- Changes the default serial device driver assignment (COM1: through COM4:) for the AUX: device.
- Prevents access to character devices outside the phantom \DEV directory.
- Loads a base device driver into memory.
- Produces a beep sound even if audible alerts are disabled.
- Defines the operating system to boot next.
- Enables or disables extended Ctrl+C checking.
- Sets the number of disk buffers allocated.
- Similar to BUFFERS but loads buffers into HMA or UMB memory areas.
- , CACHETTL, CACHEFLUSH (Embedded DOS 6-XL only)
- Control cache block allocation and flushing timing.
- Loads programs within CONFIG.SYS, pausing processing until they return.
- Sets keyboard Caps Lock state at startup.
- , CDDBUFFERS (PTS-DOS only)
- Configures CD-ROM driver name and buffer quantity.
- Continues CONFIG.SYS processing from another file or label.
- , CLS, CODEPAGE (various OS-specific)
- Configure system clock type, clear screen, specify OEM codepages.
- , COLOR (PTS-DOS only)
- Defines CMOS RAM address and boot menu color schemes.
- , COM2, COM3, COM4 (DR-DOS 7.02+)
- Specifies count, order, I/O addresses, and timeouts for serial devices.
- , COMMENT(S) (various DOS versions)
- Sets DMA buffer parameters, redefines inline comment characters or ignores lines.
- , CPOS, CPSW (various DOS versions)
- Enables internationalization support, sets cursor position in menus, allows codepage switching.
- CPU-related directives (PTS-DOS and DR-DOS)
- Conditional execution based on CPU model and generation (e.g., CPU386 for 386+ CPUs).
DTemplate:NbndF
- Adjusts relocation of drive descriptor tables.
- Defines memory segment address for multi-sector disk data deblocking operations.
- Activates internal debugger support.
- Boot manager functionality.
- Loads device drivers into memory.
- Loads device drivers into upper memory area (equivalent to in DRDOS 5.0).
- Sets country and codepage configurations for keyboard, screen, and printer devices.
- Configures cache memory sizes.
- Defines floppy disk compatibility mode settings.
- Specifies display font selection.
- Controls loading of DOS into high memory and utilization of upper memory blocks.
- Loads DOS tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory space.
- Specifies an alternate path for DOS files.
- Sets search path for data files.
- Defines physical parameters for disk drives.
- Specifies parameters for unknown drives.
- See .
- Enables error log creation with PDUMP.nnn files on specified drives.
- Displays a message on screen during processing.
- Shows messages including ANSI escape sequences on screen.
- Adds extra verification when launching programs.
- Assigns expected error or return codes for following commands.
- Controls A20 gate state upon program start-up.
- Terminates CONFIG.SYS processing before reaching file end (except SWITCHES and SHELL under certain conditions).
- Sets hash table size to speed up file opening operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
- Number of cached File Control Blocks that can be opened simultaneously (shares buffer with FILES under DR-DOS).
- Same as FCBS but loads these into upper memory area.
- Boot manager functionality.
- Specifies maximum number of files that can be open simultaneously.
- Same as FILES but loads handles into upper memory blocks.
- Executes designated CONFIG.SYS subsections (refer to 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 execution at the indicated label.
- Continues nested CONFIG.SYS processing at a specified label, then returns to the previous point.
- Refer to , , or for additional details.
- Consult for further information.
- See for related commands.
- Refer to or for more context.
- See or for relevant instructions.
- Consult for additional guidance.
- Loads a TSR program into memory following DOS data segment relocation. Compare with INSTCDEX.
- Reference , , or for further details.
- See for related content.
- Refer to or for more information.
- Activates console and command line history buffer with advanced pattern search capabilities.
- Defines the address of the High Memory Area (HMA) segment.
- Configures energy-saving settings related to the HLT instruction.
- Enables scanning for boot sector viruses.
- Loads installable file system drivers.
- Prevents execution of designated subsections within CONFIG.SYS.
- Permits specific programs to operate at ring 2, allowing direct hardware I/O access.
- Incorporates directives from another menu block, simulated via GOSUB/RETURN in DR-DOS.
- Sets the keyboard’s Insert mode status.
- Loads a TSR program into memory.
- Installs a TSR program into upper memory, equivalent to HIINSTALL in DR DOS 5.0.
- Loads a TSR program post DOS data segment relocation. Compare with INSTCDEX.
- Adjusts PIC interrupt priorities to assign highest priority to a designated interrupt number.
KTemplate:NbndM
- Defines the keyboard layout configuration.
- Specifies the memory address of the relocated keyboard buffer.
- Sets the maximum number of accessible drives.
- Similar to LASTDRIVE but also loads Current Directory Structure into upper memory areas.
- Establishes search paths for DLL files.
- Manages compatibility settings for legacy applications.
- Determines the number of file locks allowed.
- Controls display of boot logos and startup message visibility.
- Configures count, sequence, I/O port address, and timeout parameters for LPT1 device.
- Applies the same configuration as LPT1 to LPT2 device.
- Mirrors LPT1 settings for LPT3 device.
- Enables and configures LPT4 device similarly to previous LPT devices.
- Sets delay time before elevating process priority levels.
- Defines strategy for memory allocation management.
- Specifies default method of DOS memory allocation handling.
- Declares menu options available at startup.
- Specifies color scheme for menus (emulatable using ECHO in DR-DOS).
- Assigns default menu block (can be emulated via TIMEOUT and SWITCH commands in DR-DOS).
- Defines individual menu blocks (emulatable through ECHO and SWITCH in DR-DOS).
- Enables multitrack operations on disk drives.
- Continues processing CONFIG.SYS from a new file after loading a device driver and setting the %NEWFILE% environment variable.
NTemplate:NbndQ
- Sets default response character for No () in Yes/No/Resume prompts.
- Determines whether keyboard [[Num Lock|Template:Keypress]] is enabled or disabled by default.
- Executes conditionally based on last return code or error status, e.g., .
- Displays a message and waits for user key press, similar to and commands under DR-DOS environment.
- Requires user confirmation upon encountering errors within CONFIG.SYS processing.
- Configures buffer sizes associated with LPT1, LPT2, and LPT3 ports.
- Executes conditionally on PC-compatible systems only.
- Sets parameters for priority-based scheduling management.
- Adjusts priority settings specifically for disk I/O operations programs.
- ; Changes default printer device driver assignment (e.g., switching from LPT1 to LPT3 or LPT4).
- ; Specifies whether DOS applications are permitted to execute.
- ; Loads the user interface shell environment during startup.
- ; Executes conditionally on IBM PS/1-compatible hardware platforms only.
- ; Executes conditionally on IBM PS/2-compatible systems only.
- ; Suppresses display output sent to STDOUT.
RTemplate:NbndT
- Activates automatic system reboot upon encountering errors.
- Permits the inclusion of comments within CONFIG.SYS.
- Allocates a drive letter for local block device drivers.
- Sets the default Resume () option in Yes/No/Resume prompts.
- Returns nested CONFIG.SYS processing control to the previous GOSUB or SWITCH statement, optionally with a return code.
- Defines the size of real mode memory available.
- Loads programs specified in CONFIG.SYS simultaneously in the background, functioning similarly to CALL or INSTALL commands in DOS.
- Stores the initial character of deleted files within the reserved FAT area.
- Determines video mode under FreeDOS or screen access methods for PTS-DOS.
- Controls the Scroll Lock key status on the keyboard, turning it on or off.
- Sets environment variables within the system.
- Loads the command interpreter shell.
- Functions like SHELL but includes a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMBs, enhancing memory efficiency.
- Specifies keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
- Determines whether files are closed automatically when Ctrl+Alt+Del is pressed.
- Indicates whether POST routines should be skipped during reboot.
- , STACKSIZE, STACKSHIGH
- Manage hardware interrupt stack sizes and configurations across various DOS variants with upper memory support where applicable.
- , SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
- PTS-DOS utilities for boot sequence control, alternative system loading methods, memory setup, and loading DOS components into UMBs to optimize performance.
- , SWITCH
- Provides conditional processing directives to control CONFIG.SYS execution flow under multiple DOS versions, excluding DR-DOS and FreeDOS where similar functionality is available via other commands.
- , SWAPPATH, THREADS, TIMESLICE
- Parameters specific to OS/2 that handle error management, define swap file locations, configure threading concurrency, and manage scheduler time slices.
- , TRACE
- Manages single-step execution timeouts and enables tracing or logging of system initialization processes across DR-DOS, PTS-DOS, FreeDOS, and OS/2 systems—with noted differences in OS/2 implementation.
- Additional options include TMPEXT for defining temporary file extensions (PTS-DOS) and SXFAKEHWFPU for addressing particular hardware issues (OS/2 Warp).
UTemplate:NbndZ
- Directs DOS to designate a specific segment as UMB memory space.
- Sets which UMB server is utilized by the system.
- Defines address ranges allocated as UMB RAM.
- Toggles disk write verification on or off.
- Reports a designated DOS version number to applications.
- Controls VGA display status settings.
- Specifies the active video mode configuration.
- Enables or disables the use of virtual DMA capabilities.
- Toggles Virtual Mode Extensions (VME) functionality.
- Configures VxD drivers intended for Windows environments.
- Sets system parameters supporting Windows operation.
- Manages relocation of the Extended BIOS Data Area (XBDA).
- Allows conditional execution on XT-compatible hardware platforms.
- Enables built-in Year 2000 compliance support features.
- Defines the default affirmative character used in prompts.
- Manages tracking of file deletions.
Issues
Although booting is possible without CONFIG.SYS or AUTOEXEC.BAT files, these are vital for customizing DOS behavior and loading necessary software components. Corruption or loss of these files requires diagnostic intervention.
In cases where CONFIG.SYS lacks a SHELL directive or is damaged/missing, DOS attempts to locate COMMAND.COM in the root directory. Versions prior to 6.0 will fail to boot if COMMAND.COM is absent. However, MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later display a prompt requesting the user to specify a command interpreter path. This prompt also appears if COMMAND.COM terminates unexpectedly or exits intentionally, allowing temporary shell replacement without restarting.
COMMAND.COM from MS-DOS version 7.0 onward is incompatible with DR-DOS but often coexists within dual-boot environments. Starting with DR-DOS version 7.02, SHELL directives are enforced during skip/trace/step operations: if missing or invalid shell filenames are detected, users are prompted before loading COMMAND.COM from root. This mechanism prevents circumvention of shell directives and facilitates recovery from erroneous shell parameters.
CONFIG.SYS size limitations differ by operating system: MS-DOS and PC DOS restrict file size to several kilobytes (up to approximately 64 KB), whereas DR-DOS imposes no practical limit because it processes directives line-by-line instead of compiling them into memory tokens. This design grants DR-DOS users full flexibility in ordering DEVICE and INSTALL commands to manage driver and TSR loading sequences effectively and resolve conflicts while integrating transient programs into startup routines.
Limits on SHELL command line length also vary: MS-DOS/PC DOS versions between 2.0 and 4.01 allow up to 31 characters; subsequent versions extend this limit up to 128 characters. DR-DOS supports command lines up to 255 characters in length. Notably, CONFIG.SYS directives do not accommodate long filenames.
Dual booting DOS and Windows 9x
When Windows 95 is installed over a pre-existing DOS or Windows system, the files CONFIG.SYS and AUTOEXEC.BAT are renamed to CONFIG.DOS and AUTOEXEC.DOS to enable dual boot functionality between DOS and Windows 9x. During a DOS boot, these files are temporarily reverted to their original filenames. The Windows 95 versions are backed up under the names CONFIG.W40 and AUTOEXEC.W40.
In cases where Caldera DR-DOS 7.02/7.03 is installed alongside Windows 95, the original CONFIG.SYS and AUTOEXEC.BAT files for Windows remain intact. Instead, DR-DOS employs separate startup scripts named DCONFIG.SYS and AUTODOS7.BAT.
OS/2 / Windows NT
OS/2 depends extensively on CONFIG.SYS to set up device drivers and environment variables prior to launching its graphical user interface.
Within the OS/2 subsystem of Windows NT, the configuration settings typically found in CONFIG.SYS are maintained within the system registry rather than as a standalone file.
A significant portion of CONFIG.SYS commands in OS/2 lack comprehensive or clear documentation.
CONFIG.SYS continues to be used by OS/2-based operating systems 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 at Computer Hope
- Overview of CONFIG.SYS directives for Windows 98 / MS-DOS 7.10 (archived)
- Caldera’s CONFIG.SYS Command Reference (archived) – overview of DR-DOS 7 directives
- FreeDOS CONFIG.SYS directive descriptions
- PTS-DOS 2000 Pro User Manual including CONFIG.SYS directive details
- Unofficial German PTS-DOS FAQ (PTS/FAQD) with additional CONFIG.SYS directives