PROTECTONLY (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Operating systems |
| Founded | 1983 |
| Products | Configuration settings for DOS and OS/2 |
CONFIG.SYS serves as the chief configuration file for DOS and OS/2 operating systems. This plain text ASCII file holds setup commands that the operating system's DOS BIOS evaluates during the startup sequence. CONFIG.SYS first appeared with DOS version 2.0.
Usage
These commands tailor DOS settings related to hardware devices, software applications, and memory allocation. Once CONFIG.SYS is processed, DOS initiates the command interpreter specified by the SHELL directive; if none is defined, it defaults to COMMAND.COM, which then executes AUTOEXEC.BAT.
Typically, CONFIG.SYS contains name=value instructions that configure adjustable options or load components such as device drivers and terminate-and-stay-resident programs (TSRs). This file is located in the boot drive's root directory.
The CONFIG.SYS filename is also utilized by (DCP), an MS-DOS variant developed by East-German VEB Robotron.
Certain DOS variants prioritize alternative configuration filenames over CONFIG.SYS:
Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 employ CCONFIG.SYS or CCONFIG.INI instead. REAL/32 additionally may use MCONFIG.SYS. These platforms support extra configuration options stored in binary files like CCONFIG.BIN, which are generally managed via CONFIG.EXE.
From DR DOS version 3.31 onward—including PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02+—a file named DCONFIG.SYS takes precedence over CONFIG.SYS. This arrangement aids in disk compression configurations and multi-boot setups. OpenDOS 7.01 and DR-OpenDOS 7.02 also recognize ODCONFIG.SYS, while select DR-DOS 7.02+ releases check for DRCONFIG.SYS.
Starting with DR DOS 6.0, the command SYS /DR:ext enables customization of default system file extensions, allowing multiple distinct configurations to coexist within a single root directory and be selected through boot loaders like LOADER. The SHELL statement supports specifying alternative AUTOEXEC.BAT files using /P[:filename.ext], with COMMAND.COM accepting extensions beyond ".BAT" in this context.
From version 6.0 onward, DR-DOS includes support for CHAIN=filespec, permitting continuation of configuration processing from another file that may reside outside the boot drive root directory. DR-DOS 7.02+ introduces an optional parameter to jump directly to specific labels within chained files. Furthermore, DR-DOS 7.03+ allows copying of CONFIG.SYS and AUTOEXEC.BAT alongside system files using SYS /A.
Other operating systems use different configuration filenames: FreeDOS employs FDCONFIG.SYS; RxDOS version 7.24 and above uses RXCONFIG.SYS; while PTS-DOS relies on CONFIG.PTS.
Windows 95 and Windows 98, which are based on DOS, include CONFIG.SYS and AUTOEXEC.BAT on their boot drives but often leave them empty. In contrast, Windows Me does not process CONFIG.SYS during startup, instead loading environment variables from the Windows Registry.
For FlexOS, CONFIG.SYS is a binary file that defines resource managers and device drivers loaded during 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>
:;*?!
- Establishes labels within CONFIG.SYS to serve as jump points for , , , , and commands.
- Functions similarly to , but allows inline comments to follow other directives. (In MS-DOS/PC DOS, inline comments behave differently when enclosed in double quotes.)
- Used at the start of inline comments in conjunction with the ; directive.
- Prompts the user with a Yes/No question before executing subsequent CONFIG.SYS commands. (FreeDOS does not support custom messages but allows conditional handling via boot menus.) Starting from DOS 6.0, a comparable feature exists by appending after directives.
- Forces unconditional execution of the next CONFIG.SYS directive.
ATemplate:NbndC
- Determines whether programs can be terminated upon encountering errors.
- Configures drive settings to record file access dates within FAT file systems.
- Enables conditional execution tailored for AT-compatible systems.
- Boot management utility.
- Adjusts the verbosity level of error messages.
- Alters the default serial device driver assigned to the AUX device.
- Restricts access to character devices outside of the phantom \DEV directory.
- Loads a fundamental device driver into memory.
- Produces an audible beep even if sound notifications are deactivated.
- Defines which operating system should be booted next.
- Enables or disables extended Ctrl+C interrupt checking.
- Specifies how many disk buffers are allocated.
- Loads buffer memory explicitly into HMA or UMB areas.
- Sets the maximum number of cache blocks allocated from the system pool.
- Defines the maximum duration before unused cache blocks are returned to the system pool.
- Sets the maximum time interval before dirty cache blocks are written back to disk.
- Executes programs within CONFIG.SYS and pauses processing until they complete.
- Determines the status of the keyboard Caps Lock key.
- Specifies the hardware driver name for CD-ROM devices.
- Sets the number of buffers used for CD-ROM access.
- Continues processing CONFIG.SYS from a new file or label location.
- Indicates the type of clock utilized by the system.
- Clears the screen display.
- Defines OEM codepage(s) in use.
- Specifies CMOS RAM address settings.
- Sets color schemes for boot menu displays.
- Defines count, sequence, I/O addresses, and timeout values for COM ports (applicable from DR-DOS 7.02 onwards).
- DMA buffer configuration (specific to PTS-DOS).
- Redefines lead characters for inline comments or causes subsequent lines to be ignored (behavior varies by operating system).
- Enables and configures international language support (implementation differs across OS versions).
- Positions cursor on screen for configuration menus (available in DR DOS 6.0 and later).
- Supports codepage switching features (found in MS-DOS versions 4.00-4.01).
- CPU-related directives allow conditional execution based on processor type and capabilities (specific to PTS-DOS and DR-DOS).
DTemplate:NbndF
- Adjusts relocation settings for drive descriptor tables.
- Defines memory segment address used for multi-sector disk data deblocking operations.
- Activates internal debugger functionality.
- Boot management utility.
- Loads device drivers into conventional memory space.
- Loads device drivers into upper memory blocks (equivalent to in DRDOS 5.0).
- Configures regional settings including country codes and codepages for keyboard, screen, and printer devices.
- Sets sizes for cache memory allocations.
- Determines floppy disk compatibility modes.
- Specifies font used for display output.
- Controls loading of DOS into high memory and utilization of upper memory areas (similar functionality as in DRDOS 5.0).
- Loads DOS internal tables such as BUFFERS, FCBS, and FILES into upper memory regions.
- Specifies alternative directories for DOS system files.
- Defines search paths for data files.
- Sets physical parameters of disk drives.
- Establishes parameters for drives that are not recognized automatically.
- See .
- Enables error log generation with
PDUMP.nnnfiles on specified drives. - Displays messages on-screen during boot or configuration processes.
- Displays messages incorporating ANSI Escape sequences for enhanced formatting.
- Specifies additional validation checks when launching programs.
- Defines expected error or return codes from executed programs.
- Sets the A20 gate state at program startup to control memory addressing above 1 MB.
- Terminates CONFIG.SYS processing prematurely, except for certain directives which continue execution.
- Configures hash table size used to accelerate file open operations, differing from MS-DOS/PC DOS FASTOPEN driver implementations.
- Sets number of cached File Control Blocks open simultaneously (shares buffer space with FILES under DR-DOS).
- Similar to FCBS but loads these structures explicitly into upper memory areas.
- Boot manager functionality integrated here as well.
- Sets maximum number of files that can be opened concurrently by the system.
- Provides functionality like FILES but loads file handles explicitly into upper memory blocks.
- Includes execution of specific CONFIG.SYS subsections (also related to IGNORE directive).
GTemplate:NbndI
- Waits for a key press or timeout, setting the error level to the ASCII value of the key pressed (or 1024 if timed out).
- Resumes CONFIG.SYS processing at a designated label.
- Continues nested CONFIG.SYS execution at a specified label, returning to the prior location afterward.
- Refer to , , or for additional details.
- Consult for further information.
- See for related commands.
- Refer to or for more context.
- See or for further guidance.
- Consult for related usage.
- Loads a TSR program into memory similarly to , but after relocating the DOS data segment.
- See , , or for comparable instructions.
- Refer to for additional options.
- See or for supplementary commands.
- Activates console and command line history buffer with enhanced pattern search capabilities.
- Specifies the segment address of the High Memory Area (HMA).
- Configures energy-saving mode using HLT instruction.
- Determines whether the system scans for boot sector viruses during startup.
- Loads installable file system drivers.
- Prevents execution of designated CONFIG.SYS subsections.
- Grants certain programs permission to execute at ring 2, allowing direct hardware I/O access.
- Incorporates directives from another menu section (emulated via GOSUB/RETURN in DR-DOS).
- Sets the status of keyboard Insert mode.
- Loads a TSR program into memory.
- Installs TSR into upper memory area, equivalent to HIINSTALL in DR DOS 5.0.
- Loads TSR after relocation of the DOS data segment.
- Adjusts PIC interrupt priority by rotating priorities to favor a specific IRQ number.
KTemplate:NbndM
- Defines the keyboard layout configuration.
- Sets the address for the relocated keyboard buffer in memory.
- Establishes the maximum number of accessible drive letters.
- Similar to LASTDRIVE but loads Current Directory Structure (CDS) into upper memory instead.
- Specifies search paths for DLL files.
- Manages compatibility settings for legacy applications.
- Determines the number of allowable file locks.
- Controls boot logo display, supporting startup messages when used with PTS-DOS boot manager.
- Configures parameters such as count, order, I/O port address, and timeout duration for LPT1 device.
- Provides similar configuration options for LPT2 device.
- Configures LPT3 device with analogous settings.
- Enables and sets up LPT4 device parameters.
- Defines wait time before increasing process priority level.
- Controls strategy used for memory allocation by the system.
- Sets default DOS memory allocation method.
- Specifies available menu options within CONFIG.SYS environment.
- Defines menu color schemes (can be emulated using ECHO in DR-DOS).
- Sets default menu block selection (emulatable via TIMEOUT and SWITCH in DR-DOS).
- Establishes multiple menu blocks (can be emulated using ECHO and SWITCH commands in DR-DOS).
- Enables multitrack operations on disk drives.
- Continues processing CONFIG.SYS from a different file, optionally loading a device driver and setting %NEWFILE% environment variable accordingly.
NTemplate:NbndQ
- Sets the default No () response character in Yes/No/Resume prompts.
- Determines whether keyboard [[Num Lock|Template:Keypress]] is activated by default.
- Executes commands conditionally based on the last return code or error status, e.g., .
- Functions like and , displaying text and awaiting key input from user.
- Specifies if user confirmation is required upon errors encountered in CONFIG.SYS processing.
- Configures buffer sizes assigned to LPT ports.
- Enables conditional execution on PC-compatible systems only.
- Adjusts priority scheduling configurations within the system.
- Sets priority levels specifically for disk I/O related programs.
- Changes default printer driver assignment (e.g., switching from LPT1 to LPT3 or LPT4).
- Indicates whether DOS applications are permitted to run under current configuration.
- Loads a user interface component during startup sequence.
- Allows conditional execution on IBM PS/1-compatible hardware platforms only.
- Enables conditional execution on IBM PS/2-compatible machines exclusively.
- Suppresses output sent to standard output display (STDOUT).
RTemplate:NbndT
- Determines whether the system should automatically reboot following errors.
- Permits inclusion of comments within CONFIG.SYS.
- Reserves a specific drive letter from local block device drivers.
- Sets the default Resume () response character for Yes/No/Resume prompts.
- Returns nested CONFIG.SYS processing to the preceding GOSUB or SWITCH point, optionally with a return code.
- Defines the size of real mode memory.
- Enables simultaneous loading of programs in CONFIG.SYS in the background, akin to CALL or INSTALL commands under DOS/OS/2.
- Indicates if the initial character of deleted files is saved in the FAT reserved area.
- Determines video mode under FreeDOS or screen access methods utilized by PTS-DOS.
- Sets the status of the keyboard Scroll Lock key as enabled or disabled.
- Establishes environment variables.
- Loads the command interpreter shell.
- Similar to SHELL but includes a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMBs to prevent fragmentation.
- Specifies the state of keyboard modifiers such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
- Configures whether files are closed upon pressing Ctrl+Alt+Del.
- Determines if POST is bypassed during reboot sequences.
- Sets the number of hardware interrupt stacks.
- Defines default stack size for newly created threads.
- Functions like STACKS but allocates buffers into upper memory areas.
- Manages boot manager settings.
- Reserved for internal system use.
- Controls behavior of the XMS A20 gate.
- Defines submenu blocks emulatable on DR-DOS systems.
- Redirects error logging to a drive instead of displaying pop-up screens.
- Specifies swap file location settings.
- Allows conditional continuation of nested CONFIG.SYS at designated labels based on key input, returning to previous execution points.
- Sets default switch character ('/' or '-').
- Defines special configuration options.
- Enables a fix addressing floating-point unit rounding errors.
- Specifies an alternative DOS OS filename for booting purposes.
- Configures memory placement for DOS components.
- Loads system components from an alternative disk sector.
- Sets size parameters for dynamic system memory pools.
- Loads DOS data and code into Upper Memory Blocks (UMBs).
- Specifies the number of concurrent threads allowed.
- Defines timeouts for CONFIG.SYS single-step execution, SWITCH and GETKEY commands, and default Yes/No responses.[1]
- Configures minimum and maximum scheduler time slice values.
- Specifies file extensions used for temporary files.
- Toggles global or local single-step execution for CONFIG.SYS and AUTOEXEC.BAT.[2]
- Sets size for TRACE log buffers.
- Records detailed error information during traps or faults.
UTemplate:NbndZ
- Configures DOS to utilize a specified segment as Upper Memory Block (UMB) memory.
- Determines which UMB server is employed.
- Defines address ranges allocated as UMB RAM areas.
- Enables or disables verification of disk writes.
- Specifies the DOS version reported to applications.
- Configures VGA display status settings.
- Sets current video mode, comparable to SCREEN under FreeDOS.
- Enables or disables usage of virtual DMA capabilities.
- Controls deactivation of processor Virtual Mode Extensions (VME).
- Manages configuration of VxD drivers for Windows environments.
- Sets system support parameters for Windows integration.
- Adjusts relocation settings for the Extended BIOS Data Area (EBDA).
- Enables conditional execution on XT-compatible hardware platforms.
- Configures built-in Year 2000 (Y2K) support mechanisms.
- Specifies default character used as affirmative response in prompts.
- Manages tracking options for file deletions.
Issues
Although the operating system can initialize without the presence of CONFIG.SYS or AUTOEXEC.BAT, these configuration files are crucial for tailoring the OS environment and satisfying application demands. Any corruption or absence of these files requires diagnostic efforts.
In cases where CONFIG.SYS does not contain a SHELL command or if the file is missing or damaged, 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 cannot be found. Starting with MS-DOS 6.0, PC DOS 6.1, Novell DOS 7, and subsequent releases, the system will prompt the user to provide a path to a command interpreter if COMMAND.COM is unavailable or if the shell terminates unexpectedly. This prompt also enables limited runtime replacement of the shell without requiring a system reboot.
The COMMAND.COM included with MS-DOS 7.0 and later is not compatible with DR-DOS, which enforces strict adherence to SHELL directives during skip, trace, and step modes, thereby preventing circumvention in dual-boot environments. Later DR-DOS updates have partially restored skip functionality to allow recovery from invalid SHELL parameters. When bypassing CONFIG.SYS processing without a valid SHELL directive, users must explicitly specify a shell filename before loading COMMAND.COM.
The size of CONFIG.SYS is limited to a few kilobytes in MS-DOS and PC DOS (with upper limits reaching 64 KB in recent editions), whereas DR-DOS imposes no such size restriction due to its distinct processing approach. MS-DOS compiles CONFIG.SYS into a tokenized memory structure and organizes directives by category (loading device drivers before TSRs), while DR-DOS processes each line sequentially, providing granular control over loading order and conditional execution based on factors like CPU type or error states. This methodology supports temporary insertion of external utilities via INSTALL, enhancing both customization options and troubleshooting capabilities.
The maximum length of the SHELL command line has expanded from 31 characters in MS-DOS/PC DOS versions 2.0 through 4.01 to 128 characters in later versions; DR-DOS accommodates up to 255 characters. It should be noted that CONFIG.SYS directives do not support long filenames.
Dual booting DOS and Windows 9x
When Windows 95 is installed over an existing DOS or Windows installation, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed to CONFIG.DOS and AUTOEXEC.DOS respectively. This renaming facilitates seamless dual-booting between Windows 9x and DOS environments by restoring these filenames temporarily when booting into DOS mode. Additionally, backup copies of the Windows 95 versions are preserved under the names CONFIG.W40 and AUTOEXEC.W40.
In contrast, installing Caldera DR-DOS versions 7.02 or 7.03 alongside Windows 95 retains the default Windows filenames for CONFIG.SYS and AUTOEXEC.BAT, while DR-DOS utilizes alternate startup file names such as DCONFIG.SYS and AUTODOS7.BAT.
OS/2 / Windows NT
OS/2 depends extensively on CONFIG.SYS for setting up device drivers and configuring the environment prior to launching its graphical user interface.
Within the OS/2 subsystem integrated into Windows NT, what appears as CONFIG.SYS to OS/2 applications is actually maintained within the Windows registry rather than as a traditional file.
Numerous CONFIG.SYS commands available in OS/2 lack comprehensive documentation or remain largely undocumented.
The use of CONFIG.SYS continues in OS/2 derivatives including 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
- 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
- Explanation of FreeDOS CONFIG.SYS directives
- PTS-DOS 2000 Pro User Manual covering CONFIG.SYS commands (archived)
- Unofficial German PTS-DOS FAQ including CONFIG.SYS information (archived)