RUN (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Computer software |
| Founded | 1983 |
| Products | Configuration directives for DOS and OS/2 |
CONFIG.SYS serves as the essential configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, contains configuration commands that the operating system's DOS BIOS interprets 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 allocation. Once these instructions are processed, DOS launches the command interpreter specified by the SHELL directive; if none is defined, it defaults to COMMAND.COM, which then executes AUTOEXEC.BAT.
CONFIG.SYS primarily consists of name=value entries that either adjust configurable settings or load device drivers and terminate-and-stay-resident (TSR) programs.
In DOS systems, this file is located in the root directory of the bootable drive.
Several MS-DOS variants utilize different filenames:
- Concurrent DOS and Multiuser DOS editions may employ CCONFIG.SYS or CCONFIG.INI, with additional parameters stored in a binary file named CCONFIG.BIN, usually managed through CONFIG.EXE.
- From DR DOS version 3.31 onward, DCONFIG.SYS takes precedence over CONFIG.SYS to support features such as disk compression and multi-boot setups.
- OpenDOS 7.01 and DR-OpenDOS 7.02 recognize alternative files like ODCONFIG.SYS or DRCONFIG.SYS.
- Starting with DR-DOS 6.0, users can modify default system file extensions using SYS /DR:ext, allowing multiple concurrent system files handled by boot loaders such as LOADER.
- The SHELL command allows specifying alternative AUTOEXEC.BAT files through the /P[:filename.ext] option, and COMMAND.COM accepts extensions other than .BAT.
- DR-DOS introduces a CHAIN=filespec[,label] directive to continue processing configuration from another file or label.
- Since DR-DOS 7.03, the command SYS /A enables copying CONFIG.SYS and AUTOEXEC.BAT alongside system files.
Other DOS derivatives also adopt similar conventions: - FreeDOS uses FDCONFIG.SYS - RxDOS employs RXCONFIG.SYS - PTS-DOS relies on CONFIG.PTS
In the case of Windows 95 and Windows 98, which are built on DOS foundations, CONFIG.SYS and AUTOEXEC.BAT exist but are typically left empty. Conversely, Windows Me does not process CONFIG.SYS during startup; instead, it retrieves environment variables directly from the Windows Registry.
For FlexOS, CONFIG.SYS is a binary configuration file that specifies resource managers and device drivers.
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>
:;*?!
- Marks labels within CONFIG.SYS to serve as jump points for commands like , , , , and .
- Functions similarly to , also utilized for inline comments after other commands. (Note: MS-DOS/PC DOS does not ignore inline comments enclosed in double quotes.)
- Enables inline commentary alongside the ; directive.
- Presents a Yes/No prompt to confirm whether subsequent CONFIG.SYS commands should execute. (FreeDOS lacks customizable messages but supports conditional boot menus.) DOS 6.0 and later provide a comparable feature by appending after directives (e.g., ).
- Forces unconditional execution of the next command.
ATemplate:NbndC
- Determines whether programs may be terminated upon encountering errors.
- Sets which drives record file access timestamps in FAT file systems.
- Enables conditional command execution on AT-compatible computers.
- Manages boot options.
- Adjusts the level of detail for error messages.
- Changes the default serial driver used for the AUX device.
- Restricts access to character devices outside the phantom \DEV directory.
- Loads the fundamental device driver into system memory.
- Produces a brief beep sound even if audible alerts are disabled.
- Specifies the operating system designated for the next boot.
- Activates or deactivates extended Ctrl+C detection.
- Defines the quantity of disk buffers to allocate.
- Explicitly loads buffers into High Memory Area (HMA) or Upper Memory Blocks (UMB).
- Sets the maximum number of cache blocks allocated dynamically.
- Defines the maximum idle time before unused cache blocks are released back to the system pool.
- Specifies the maximum interval before dirty cache blocks are written to disk.
- Executes programs listed in CONFIG.SYS in the foreground, pausing further processing until completion.
- Controls the Caps Lock keyboard state.
- Indicates the driver name for CD-ROM hardware.
- Determines the number of buffers allocated for CD-ROM access.
- Continues processing CONFIG.SYS from a new file and optional label, supported since DR-DOS 7.02.
- Identifies the type of system clock in use.
- Clears the display screen.
- Defines OEM codepages used by the system.
- Specifies CMOS RAM address locations.
- Sets color schemes for boot menus.
- Configures I/O port addresses and timeout values for COM1 device.
- Configures I/O port addresses and timeout values for COM2 device.
- Configures I/O port addresses and timeout values for COM3 device.
- Configures I/O port addresses and timeout values for COM4 device.
- Assigns buffer settings for DMA operations.
- Redefines comment lead-in characters or causes subsequent lines to be ignored.
- Activates and configures international language support features.
- Positions cursor on screen within configuration menus.
- Enables support for codepage switching functionality.
- Sets RAM refresh rates.
- , ;, ;, ;, ;, ;, ;, ;, ;, ;
- Allows conditional execution based on CPU type or generation to optimize configurations per hardware capabilities.
DTemplate:NbndF
- Adjusts relocation settings for drive descriptor tables.
- Specifies memory segment address used for multi-sector disk data deblocking processes.
- Enables internal debugging support within the system.
- Manages boot options and selection.
- Loads a device driver into memory space.
- Loads a device driver specifically into upper memory (similar to in DRDOS 5.0).
- Sets country and codepage configurations for keyboard, screen, and printer devices (KBD, SCR, LPT).
- Configures sizes of cache memory allocations.
- Defines compatibility mode settings for floppy disk drives.
- Selects display font parameters.
- Controls loading of DOS components into high memory and upper memory areas.
- Loads DOS system tables such as BUFFERS, FCBS, FILES, LASTDRIVE, and STACKS into upper memory space.
- Specifies an alternate directory path where DOS files are located.
- Sets search paths for locating data files during operation.
- Defines parameters related to physical disk drives in use.
- Establishes parameters applicable to unrecognized or unknown drives.
- See .
- Enables error log creation with PDUMP.nnn files and specifies target drive location.
- Displays textual messages on-screen during processing.
- Outputs messages incorporating ANSI escape sequences for formatting effects.
- Specifies additional verification checks when launching programs.
- Assigns assumed error or return codes for commands executed subsequently.
- Controls A20 gate status when starting programs to manage memory addressing modes.
- Terminates CONFIG.SYS processing prematurely except for certain specified directives.
- Sets hash table size used to accelerate file open operations, differing from MS-DOS/PC DOS FASTOPEN driver implementation.
- Defines number of cached File Control Blocks (FCBs) allowed open simultaneously (shares buffer with FILES under DR-DOS).
- Similar to FCBS but explicitly loads FCBs into upper memory areas.
- Boot manager functionality included here as well.
- Limits number of files that can be opened at once by the system.
- Same as FILES but forces file handles to load into upper memory explicitly.
- Facilitates execution of specified CONFIG.SYS subsections related to IGNORE directive.
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 processing of CONFIG.SYS at the indicated label.
- Continues nested CONFIG.SYS processing at a specified label, then returns to the previous position.
- Refer to , , or for additional information.
- See also .
- Refer to .
- Consult or for related commands.
- Consult or for further details.
- See also .
- Loads a terminate-and-stay-resident (TSR) program into memory after relocating the DOS data segment. Compare with INSTCDEX.
- Refer to , , or for more details.
- See also .
- Consult or for additional context.
- 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 behavior related to the HLT instruction.
- Specifies whether to perform a virus check on the system boot sector.
- Loads installable file system drivers.
- Prevents execution of certain CONFIG.SYS subsections.
- Permits specific programs to execute at ring 2, allowing direct hardware input/output access.
- Incorporates directives from another menu block, functionally similar to GOSUB/RETURN in DR-DOS environments.
- Sets the keyboard's Insert mode status.
- Installs a TSR program into memory.
- Loads a TSR program into upper memory, equivalent to HIINSTALL in DR DOS 5.0.
- Installs a TSR program after relocating the DOS data segment, similar in function to INSTALL.
- Adjusts PIC interrupt priorities by rotating them to prioritize a designated IRQ number.
KTemplate:NbndM
- Defines the keyboard layout configuration.
- Sets the memory address of the relocated keyboard buffer.
- Determines the maximum number of drives accessible by the system.
- Functions like LASTDRIVE but additionally loads Current Directory Structure (CDS) into upper memory.
- Specifies search paths for dynamic-link libraries (DLLs).
- Manages compatibility settings for legacy software applications.
- Sets the quantity of file locks allowed.
- Configures support for boot logos and startup messages when using PTS-DOS boot manager.
- Defines parameters such as count, logical order, I/O port address, and timeout duration for LPT1 device.
- Applies identical settings as LPT1 for LPT2 device configuration.
- Mirrors LPT1 settings for LPT3 device as well.
- Enables and configures LPT4 device similarly to other parallel ports.
- Establishes wait time before increasing process priority level.
- Sets strategies for memory allocation management.
- Determines default memory allocation approach within DOS environment.
- Specifies available menu options within CONFIG.SYS menus.
- Defines color schemes for menus, which can be simulated under DR-DOS using ECHO commands.
- Sets default menu block selection, emulatable in DR-DOS through TIMEOUT and SWITCH directives.
- Defines menu blocks that can be emulated in DR-DOS with ECHO and SWITCH commands.
- Enables or disables multitrack disk operation support.
- Continues CONFIG.SYS processing from another file, optionally loading a device driver and setting %NEWFILE% environment variable.
NTemplate:NbndQ
- Establishes default No () response character for Yes/No/Resume prompts.
- Controls keyboard [[Num Lock|Template:Keypress]] status on startup.
- Enables conditional command execution based on previous error codes, such as .
- Displays text and waits for a key press, similar to DR-DOS's and commands.
- Requires user confirmation upon encountering errors during CONFIG.SYS processing.
- Sets buffer size parameters for LPT port operations.
- Allows conditional execution on PC-compatible hardware platforms.
- Configures process scheduler priority levels.
- Sets priority levels specifically for disk I/O programs.
- Changes default printer device driver assignment (for example, switching from LPT1 to LPT3 or LPT4).
- 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 systems.
- Enables conditional execution on IBM PS/2-compatible systems.
- Suppresses output directed to STDOUT.
RTemplate:NbndT
- Activates automatic system reboot upon encountering errors.
- Permits inclusion of comments within CONFIG.SYS files.
- Allocates a drive letter specifically for local block device drivers.
- Defines the default Resume () prompt character.
- Returns control from nested CONFIG.SYS processing back to the point after a GOSUB or SWITCH command, optionally passing a return code.
- Sets the amount of real mode memory available.
- Allows simultaneous loading of programs in CONFIG.SYS in the background, functioning similarly to CALL or INSTALL commands in other operating systems.
- Determines whether the first character of deleted filenames is stored in the FAT reserved area.
- Configures video modes in FreeDOS or screen access methods in PTS-DOS.
- Manages the Scroll Lock key status on the keyboard.
- Defines environment variables for the system.
- Loads the command interpreter shell.
- Similar to SHELL but includes a SIZE parameter to pre-allocate COMMAND.COM in High Memory Area (HMA) or Upper Memory Blocks (UMBs), enhancing memory efficiency with third-party shells.
- Specifies keyboard modifier key states such as Shift Lock, Num Lock, Scroll Lock, and Insert.
- Determines if files are closed when pressing Ctrl+Alt+Del.
- Skips Power-On Self-Test (POST) during reboot sequences.
- , STACKSIZE, STACKSHIGH
- Set hardware interrupt stack sizes and buffer locations across different DOS versions to improve system stability and optimize memory usage.
- , SYSBOOT, SYSGEN, SYSLOAD
- PTS-DOS-specific commands managing boot options, alternative system loading methods, and memory allocation for core system components.
- , SWITCH
- Handles nested menu structures and conditional processing within CONFIG.SYS for enhanced configuration flexibility (available from DOS 6.0 onwards).
- , SWAPPATH
- OS/2 directives specifying locations for error logs and swap file paths to increase system reliability.
- , SWITCHES
- Define default switch characters ('/' or '-') and special options to tailor command parsing behavior across various DOS implementations.
- , THREADS, TIMESLICE
- OS/2 settings controlling hardware floating-point unit fixes, the number of concurrent threads, and scheduler time slice durations to optimize system performance.
- , TRACE, TRACEBUF
- Enable stepwise execution of CONFIG.SYS with timeout controls and configure trace log buffer sizes for debugging purposes under DR-DOS, PTS-DOS, and OS/2 platforms.
- , TRAPDUMP
- Configure temporary file extensions (specific to PTS-DOS) and detailed error logging (for OS/2), aiding system diagnostics and management.
UTemplate:NbndZ
- Sets a particular segment for DOS to manage as Upper Memory Block (UMB) space.
- Selects which UMB server is utilized by the system.
- Defines address ranges that are designated as UMB RAM areas.
- Enables or disables verification of disk writes during operations.
- Specifies the DOS version string reported to software applications.
- Controls VGA display status settings.
- Indicates the current video mode in use.
- Determines whether virtual Direct Memory Access (DMA) is permitted.
- Configures whether processor Virtual Mode Extensions are disabled.
- Sets parameters for VxD drivers under Windows environments.
- Manages overall system support configurations for Windows platforms.
- Adjusts relocation settings for the Extended BIOS Data Area (XBDA).
- Executes conditional operations on XT-compatible machines only.
- Enables built-in support for Year 2000 compliance features.
- Defines the default confirmation character ('Yes') used in prompts.
- Configures tracking behavior for file deletions.
Issues
Although the system can start without CONFIG.SYS or AUTOEXEC.BAT, these files are crucial for comprehensive DOS customization and meeting software prerequisites. Troubleshooting becomes necessary if these files are missing or damaged.
When CONFIG.SYS does not include a SHELL directive or is absent/corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Earlier versions prior to 6.0 fail to boot without this file, whereas MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later versions prompt the user to specify the command processor’s path. This prompt also appears if the main command interpreter terminates unexpectedly or exits intentionally, allowing users to replace the shell temporarily during runtime without needing a reboot.
COMMAND.COM from MS-DOS 7.0 onwards is incompatible with DR-DOS, yet it is frequently found in the C: root partition within dual-boot configurations. DR-DOS versions 7.02 and above prevent skipping or tracing over SHELL directives during debugging modes to avoid conflicts. Some releases reinstated skip functionality via (Ctrl+)F6 to recover from invalid SHELL parameters. If no valid SHELL directive is detected during skip operations, users must enter a correct shell filename before COMMAND.COM loads.
CONFIG.SYS file size restrictions differ: MS-DOS and PC DOS limit files to a few kilobytes—up to 64 KB in later editions—while DR-DOS imposes no such limit besides the constraints of the file system itself. MS-DOS processes CONFIG.SYS by compiling it into a tokenized form in memory before executing directives sequentially (loading device drivers before TSRs). Conversely, DR-DOS reads CONFIG.SYS line-by-line, enabling explicit control over load order through DEVICE and INSTALL commands. This approach enhances conflict management and supports conditional execution based on hardware presence or error conditions.
This increased adaptability aids in debugging software and integrating temporary utilities via INSTALL. It should be noted that CONFIG.SYS directives do not support long filenames.
For MS-DOS/PC DOS versions 2.0 through 4.01, the SHELL directive was limited to 31 characters; this limit expanded to 128 characters in later releases, while DR-DOS allows up to 255 characters.
Dual booting DOS and Windows 9x
When Windows 95 is installed over an existing DOS or Windows setup, CONFIG.SYS and AUTOEXEC.BAT are renamed CONFIG.DOS and AUTOEXEC.DOS respectively to enable dual-boot functionality between Windows 9x and DOS environments. In DOS mode, these files are temporarily restored as CONFIG.SYS and AUTOEXEC.BAT. Backup copies of Windows 95 configuration files are saved as CONFIG.W40 and AUTOEXEC.W40.
Installing Caldera DR-DOS versions 7.02 or 7.03 alongside Windows 95 leaves Windows’ CONFIG.SYS and AUTOEXEC.BAT unchanged. Instead, DR-DOS uses alternate startup files named DCONFIG.SYS and AUTODOS7.BAT.
OS/2 / Windows NT
OS/2 relies heavily on CONFIG.SYS for loading drivers and setting environment variables prior to launching its graphical user interface.
Within the OS/2 subsystem of Windows NT, what appears as CONFIG.SYS to OS/2 applications is actually stored within the system registry.
Numerous undocumented CONFIG.SYS directives exist specifically for 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 Guide (archived) – Summary of DR-DOS 7 directives
- Details on CONFIG.SYS directives for FreeDOS
- User Manual for PTS-DOS 2000 Pro featuring CONFIG.SYS commands (archived)
- German-language unofficial PTS-DOS FAQ including CONFIG.SYS directives (archived)