HISTACKS (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Operating systems |
| Founded | 1983 |
| Headquarters | N/A |
| Products | Configuration for DOS and OS/2 boot processes |
CONFIG.SYS serves as the central configuration file for DOS and OS/2 operating systems. This specialized ASCII text file contains setup instructions that the operating system's DOS BIOS interprets during the boot sequence. CONFIG.SYS was first introduced with DOS version 2.0.
Usage
The directives within CONFIG.SYS tailor DOS settings for hardware devices, software applications, and memory allocation. Once CONFIG.SYS is processed, DOS initiates the command interpreter specified by the SHELL directive or defaults to COMMAND.COM, which subsequently executes AUTOEXEC.BAT.
CONFIG.SYS primarily comprises name=value pairs that set adjustable options or load components such as device drivers and TSR programs into memory. This file is located in the root directory of the bootable drive.
Certain DOS variants prioritize alternative filenames over CONFIG.SYS:
Advanced iterations of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI (in Multiuser DOS) instead of CONFIG.SYS. Additionally, REAL/32 seeks MCONFIG.SYS. These operating systems accommodate enhanced configuration parameters stored in binary formats like CCONFIG.BIN, which are managed through a utility called CONFIG.EXE.
From version 3.31 onwards, including PalmDOS 1.0, Novell DOS 7, and OpenDOS 7.01, DR DOS employs DCONFIG.SYS with higher priority than CONFIG.SYS. This approach supports multi-boot environments and disk compression setups where drive letter assignments shift after loading compression drivers.
OpenDOS 7.01 and DR-OpenDOS 7.02 also check for ODCONFIG.SYS, while several DR-DOS editions look for DRCONFIG.SYS. Starting with DR DOS 6.0, the SYS /DR:ext command permits modification of default system file extensions, enabling multiple configurations to coexist in a single root directory, selectable via boot loaders such as LOADER included with Multiuser DOS and DR-DOS.
The SHELL command can specify alternate AUTOEXEC.BAT files using /P[:filename.ext], and COMMAND.COM supports execution of files with extensions other than .BAT in these cases (a feature also found in 4DOS). The CHAIN=filespec directive allows continuation of configuration processing in another file, optionally targeting specific labels in DR-DOS 7.02 and later versions.
Beginning with DR-DOS 7.03, the SYS /A option copies matching CONFIG.SYS and AUTOEXEC.BAT files alongside system files during installation.
FreeDOS utilizes FDCONFIG.SYS, RxDOS employs RXCONFIG.SYS, and PTS-DOS uses CONFIG.PTS for comparable configuration purposes.
Both CONFIG.SYS and AUTOEXEC.BAT exist on boot volumes of Windows 95 and Windows 98, though they are often empty due to their DOS foundations. In contrast, Windows Me ignores CONFIG.SYS during startup, instead retrieving environment variables from the Windows Registry at:
- HKLM\System\CurrentControlSet\Control\SessionManager\Environment
In the case of FlexOS, CONFIG.SYS is a binary configuration file that defines resource managers and device drivers loaded at system initialization.
Example
Here is a sample CONFIG.SYS file 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 that serve as jump targets for commands such as , , , , and .
- Functions like , permitting inline comments after other directives. (MS-DOS/PC DOS handles inline comments differently when enclosed in double quotes.)
- Used at the start of inline comments, serving as an alternative to ;.
- Presents a Yes/No prompt to confirm execution of subsequent directives. (FreeDOS supports conditional execution with boot menus but does not provide optional messages.)
- Forces unconditional execution of the following directive.
ATemplate:NbndC
- Determines whether programs can be terminated upon errors.
- Sets which drives maintain file access date stamps on FAT file systems.
- Executes conditionally on AT-compatible hardware.
- Acts as a boot manager.
- Adjusts verbosity levels for error messages.
- Changes the default serial driver assigned to the AUX: device.
- Prevents character devices from being accessible outside the phantom \DEV directory.
- Loads a base device driver into memory.
- Triggers a beep sound regardless of notification settings.
- Defines the next operating system to boot.
- Enables or disables extended Ctrl+C checking.
- Specifies how many disk buffers to allocate.
- Similar to BUFFERS but places buffers in HMA or UMB memory areas.
- Sets the maximum number of cache blocks reserved from the system pool.
- Defines the maximum duration before unused cache blocks return to the system pool.
- Sets maximum time before dirty cache blocks are flushed to disk.
- Loads programs within CONFIG.SYS and runs them in the foreground, pausing further processing until completion.
- Indicates keyboard Caps Lock status.
- Specifies the driver name for CD-ROM hardware.
- Determines the number of buffers used for CD-ROM access.
- Continues processing CONFIG.SYS from another file or label.
- Specifies the type of system clock in use.
- Clears the screen display.
- Defines OEM codepage(s).
- Specifies CMOS RAM address parameters.
- Configures colors used in boot menus.
- Sets parameters for COM1 device including I/O address and timeout values.
- Applies COM1 settings analogously to COM2 device.
- Applies COM1 settings analogously to COM3 device.
- Applies COM1 settings analogously to COM4 device.
- Defines DMA buffer specifications.
- Redefines characters that lead inline comments or causes following line to be ignored.
- Enables and configures international language support features.
- Positions display cursor for configuration menus.
- Supports switching between codepages dynamically.
- Specifies RAM refresh rate speed.
Conditional directives based on CPU types (CPU88, CPU86, CPU286, CPU386, CPU486 and their variants) are primarily supported in PTS-DOS and DR-DOS environments, allowing CONFIG.SYS behavior tailored according to processor architecture and capabilities.
DTemplate:NbndF
- Adjusts relocation of drive descriptor tables in memory.
- Sets memory segment limit up to which multi-sector disk data deblocking is permitted.
- Enables support for an internal debugger tool.
- Functions as a boot manager utility.
- Loads a device driver into conventional memory space.
- Loads a device driver into upper memory area (equivalent to in DR-DOS 5.0).
- Configures country-specific and codepage information for keyboard, screen, and printer devices (KBD, SCR, LPT).
- Sets sizes for cache memory allocations.
- Defines compatibility mode parameters for floppy disk drives.
- Selects display font settings.
- Determines whether DOS loads into high memory and/or utilizes upper memory (similar functionality as under DR-DOS 5.0).
- Specifies if DOS tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS should be loaded into upper memory areas.
- Provides an alternative directory path for DOS system files.
- Defines search paths for data files used by DOS utilities.
- Sets physical parameters for disk drives connected to the system.
- Establishes configuration parameters for unknown or unrecognized drives.
- See .
- Enables PDUMP.nnn error logging and specifies target drive location for logs.
- Outputs a message on screen during startup or processing phases.
- Displays messages including ANSI escape sequences for enhanced formatting control.
- Determines whether additional program startup checks are performed when launching applications.
- Defines an error or return code value assumed by subsequent processes or commands.
- Sets A20 gate state when initiating program execution, affecting memory addressing modes.
- Terminates CONFIG.SYS processing before reaching end of file (exceptions apply to SWITCHES and SHELL directives under certain conditions).
- Configures size of hash table used for accelerating file open operations (differs significantly from MS-DOS/PC DOS FASTOPEN driver).
- Specifies number of cached File Control Blocks open simultaneously (in DR-DOS FCBS and FILES share buffer resources).
- Similar to FCBS but explicitly loads File Control Blocks into upper memory area.
- Boot manager utility command variant.
- Sets maximum number of files allowed open concurrently by DOS processes.
- Same as FILES but explicitly loads file handles into upper memory area for performance optimization.
- Includes execution of specified subsections within CONFIG.SYS files (see IGNORE directive).
GTemplate:NbndI
- Waits for a key press or timeout, then assigns the error level to the ASCII code (or 1024 if timed out).
- Resumes processing of CONFIG.SYS at a designated label.
- Continues nested CONFIG.SYS execution at a label, then returns to the prior 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 Terminate and Stay Resident (TSR) program after DOS relocates its data segment. Compare with INSTCDEX.
- See , , or for extended options.
- Refer to for supplementary commands.
- See or for comparable functions.
- Activates console and command line history buffers along with enhanced pattern searching capabilities.
- Defines the address of the High Memory Area (HMA) segment.
- Configures energy-saving behavior related to the HLT instruction.
- Performs checks for viruses on the boot sector.
- Loads file systems that are installable.
- Prevents execution of particular subsections within CONFIG.SYS.
- Grants specific programs permission to operate at ring 2, enabling direct hardware I/O access.
- Incorporates directives from an alternate menu block, emulated via GOSUB/RETURN in DR-DOS environments.
- Sets the status of keyboard Insert mode.
- Installs TSR programs into conventional memory.
- Loads TSR utilities into upper memory blocks (similar to HIINSTALL in DR DOS version 5.0).
- Installs TSR programs post DOS data segment relocation. Compare with INSTCDEX.
- Adjusts PIC interrupt priority order to favor a specified IRQ number.
KTemplate:NbndM
- Defines the keyboard layout configuration.
- Indicates the relocated keyboard buffer's memory address.
- Sets the maximum number of accessible drive letters.
- Functions like LASTDRIVE but also loads Current Directory Structure (CDS) into upper memory areas.
- Specifies directory paths where DLLs are searched for.
- Provides compatibility support for legacy software applications.
- Determines the quantity of file locks allowed.
- Enables boot logo display support when using PTS-DOS boot manager.
- Configures parameters such as count, sequence, I/O address, and timeout for the LPT1: device.[1]
- Mirrors LPT1 settings for LPT2: device.[1]
- Applies LPT1 configuration similarly to LPT3: device.[1]
- Activates and configures LPT4: device in a comparable manner.
- Sets the delay before a waiting process is elevated in priority by the scheduler.
- Determines strategy for allocating memory resources.
- Specifies default DOS memory allocation policy.
- Defines selectable menu options within CONFIG.SYS.
- Sets color schemes for menus (can be emulated under DR-DOS).
- Establishes default menu block selection (emulatable under DR-DOS).
- Creates a menu block definition (emulatable under DR-DOS).
- Enables multitrack operations on disks.
- Continues processing CONFIG.SYS from an external file, optionally loading a driver and setting the %NEWFILE% environment variable.[2]
NTemplate:NbndQ
- Defines the default character representing No () in Yes/No/Resume prompts.
- Controls the state of keyboard [[Num Lock|Template:Keypress]] key at startup.
- Allows conditional command execution based on the most recent error code, such as .
- Displays text and waits for user key input, similar to and commands found in DR-DOS systems.
- Requires user confirmation when errors are encountered during CONFIG.SYS processing.
- Sets buffer size parameters for parallel port (LPT) devices.
- Enables conditional execution specifically on PC-compatible machines.
- Adjusts scheduler priority settings for processes.
- Assigns priority levels specifically to disk I/O-related programs.
- Changes default printer assignment among LPT1 through LPT4 devices.
- Determines whether DOS applications are permitted to execute.
- Loads a user interface shell environment.
- Enables conditional execution on IBM PS/1-compatible hardware platforms.
- Enables conditional execution on IBM PS/2-compatible hardware platforms.
- Suppresses output directed to STDOUT.
RTemplate:NbndT
- Activates automatic system reboot when errors occur.
- Permits inclusion of comments within CONFIG.SYS (not processed by PTS-DOS).
- Allocates a drive letter for local block device drivers.
- Defines the default Resume () character used in command prompts.
- Exits nested CONFIG.SYS processing by returning to the last GOSUB or SWITCH directive, optionally providing a return code.
- Sets the size of real mode memory available.
- Allows simultaneous loading of programs in CONFIG.SYS in the background, similar to DOS's INSTALL command.
- Determines whether the first character of deleted files is saved in the FAT reserved area.
- Specifies video modes for FreeDOS or screen access methods under PTS-DOS.
- Manages the Scroll Lock key status on the keyboard.
- Defines environment variables for system use.
- Loads the command interpreter shell.
- Functions like SHELL but supports a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMBs, minimizing fragmentation 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.
- Determines if POST is bypassed during reboot.
- , STACKSIZE, STACKSHIGH
- Configure stack size parameters across multiple DOS variants and platforms, applicable to hardware interrupts or thread stacks.
- , SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
- PTS-DOS-specific options managing boot managers, alternative OS boot files, system memory layouts, and loading DOS data into UMBs.
- , SUBMENU, SUPPRESSPOPUPS, SWAPPATH
- Various OS/2 and DOS settings handling internal menu usage, error popup suppression, and swap file directory paths.
- , SWITCHES, SWITCHAR
- Control conditional CONFIG.SYS processing via keypresses or special options including default switch characters ('/' or '-').
- , THREADS, TIMESLICE
- OS/2-exclusive parameters addressing FPU bug fixes, number of concurrent threads, and scheduler time slice durations.
- , TMPEXT
- Defines timeout values for CONFIG.SYS commands and temporary file extensions under DR-DOS and PTS-DOS environments.
- , TRACEBUF
- Enables or disables single-step execution tracing in CONFIG.SYS globally or locally with configurable log buffer sizes across DR-DOS, PTS-DOS, and OS/2 systems.
- Records detailed error logs on OS/2 systems version 3.0 and above.
UTemplate:NbndZ
- Directs DOS to utilize a specified segment as Upper Memory Block (UMB) memory.
- Specifies which UMB server is active.
- Defines address ranges designated as UMB RAM.
- Enables or disables verification of disk writes.
- Sets the DOS version reported to applications.
- Configures VGA display status parameters.
- Indicates the current video mode in use.
- Determines whether virtual DMA is permitted.
- Disables processor Virtual Mode Extensions (VME) if specified.
- Configures VxD drivers for Windows environments.
- Sets system support options for Windows operation.
- Controls relocation of the Extended BIOS Data Area (XBDA).
- Enables conditional execution specific to XT-compatible machines.
- Activates built-in Year 2000 compliance support.
- Defines the default affirmative character used in prompts.
- Manages tracking of file deletions.
Issues
While the system is capable of booting without CONFIG.SYS or AUTOEXEC.BAT, these configuration files are crucial for complete customization and meeting software requirements during startup. If either file becomes damaged or corrupted, troubleshooting is necessary.
In cases where CONFIG.SYS does not include a SHELL command or if the file is absent or corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. For versions earlier than 6.0, failure to find COMMAND.COM results in a boot failure. However, MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later versions will prompt the user to specify a command processor path. This recovery prompt also appears if the initial command processor terminates unexpectedly or is exited intentionally, enabling users to replace the shell temporarily without rebooting.
The COMMAND.COM included with MS-DOS 7.0 and later is not compatible with DR-DOS, which commonly resides in the root of drive C: in dual-boot configurations. Starting with DR-DOS 7.02, it is no longer possible to bypass SHELL directives when using skip, trace, or step modes; users must provide a valid shell path before COMMAND.COM can be launched from the root if none is detected.
CONFIG.SYS file size restrictions differ depending on the operating system: MS-DOS and PC DOS limit CONFIG.SYS to several kilobytes (up to 64 KB in newer releases), whereas DR-DOS imposes no significant size limits beyond those of the underlying filesystem. MS-DOS processes CONFIG.SYS by compiling it into tokenized memory structures that execute sequentially—device drivers load first, followed by terminate-and-stay-resident programs (TSRs). Conversely, DR-DOS parses CONFIG.SYS line-by-line, granting fine-grained control over loading order through DEVICE and INSTALL commands. This approach helps resolve conflicts during driver loading and supports conditional execution based on hardware presence, key presses, error conditions, or return codes.
The INSTALL directive in DR-DOS allows non-resident programs to be executed as part of CONFIG.SYS processing, facilitating seamless integration of temporary external utilities.
In MS-DOS and PC DOS versions 2.0 through 4.01, the length of SHELL lines was limited to 31 characters; subsequent versions expanded this limit to 128 characters, while DR-DOS accepts up to 255 characters. It should be noted that CONFIG.SYS directives do not support long file names.
Dual booting DOS and Windows 9x
When Windows 95 is installed over an existing DOS or Windows environment, it renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS respectively to enable dual booting between Windows 9x and DOS modes. Upon booting into DOS mode, these files are temporarily restored as CONFIG.SYS and AUTOEXEC.BAT. Copies of the original Windows 95 configuration files are preserved as CONFIG.W40 and AUTOEXEC.W40.
For systems running Caldera DR-DOS 7.02 or 7.03 alongside Windows 95, Windows’ CONFIG.SYS and AUTOEXEC.BAT remain untouched. Instead, DR-DOS uses its own startup scripts named DCONFIG.SYS and AUTODOS7.BAT.
OS/2 / Windows NT
OS/2 relies heavily on CONFIG.SYS for setting up drivers and environment variables prior to launching its graphical user interface.
Within the OS/2 subsystem embedded in Windows NT, the CONFIG.SYS environment accessed by OS/2 applications is actually maintained within the system registry.
Numerous undocumented CONFIG.SYS directives exist specifically for OS/2.
CONFIG.SYS continues to play a vital role in 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 available 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
- Guide to FreeDOS CONFIG.SYS directives
- User Manual for PTS-DOS 2000 Pro including CONFIG.SYS directives (archived)
- German-language unofficial PTS-DOS FAQ (archived) – supplementary CONFIG.SYS directives