SHELL (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Computer software |
| Founded | 1983 (with DOS version 2.0) |
| Products | System 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, holds setup commands accessible to users that are interpreted by the operating system's DOS BIOS—usually within IBMBIO.COM or IO.SYS—during system startup. CONFIG.SYS made its debut with DOS version 2.0.
Usage
The directives within CONFIG.SYS customize DOS for 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 specified, it defaults to COMMAND.COM, which subsequently runs the AUTOEXEC.BAT script.
This configuration file primarily contains name=value pairs that set parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs).
In DOS environments, CONFIG.SYS is located in the root directory of the boot drive.
Certain MS-DOS variants, including the East German (DCP) by VEB Robotron, also adopt this filename.
Various DOS distributions support alternative configuration filenames that supersede CONFIG.SYS:
- Advanced iterations of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 prioritize CCONFIG.SYS, which accommodates extra settings stored in binary CCONFIG.BIN files managed using CONFIG.EXE.
- Versions of DR DOS starting from 3.31 (including PalmDOS 1.0, Novell DOS 7, and OpenDOS 7.01) prefer DCONFIG.SYS over CONFIG.SYS, commonly utilized in conjunction with disk compression or multi-boot configurations.
- OpenDOS 7.01 and DR-OpenDOS 7.02 also seek out ODCONFIG.SYS, while some releases of DR-DOS 7.x check for DRCONFIG.SYS.
- From DR-DOS 6.0 onwards, the default configuration file extension can be altered via SYS /DR:ext, enabling multiple concurrent system file sets selectable by boot loaders such as LOADER.
- The SHELL directive supports defining alternate AUTOEXEC.BAT files using /P[:filename.ext], a feature available in both COMMAND.COM and enhanced shells like 4DOS.
- The CHAIN=filespec command permits continuation of configuration processing in another file, optionally specifying labels in DR-DOS versions 7.02 and later.
Starting with DR-DOS 7.03, the SYS /A command copies CONFIG.SYS and AUTOEXEC.BAT alongside other system files.
Other DOS-like systems have comparable mechanisms: - FDCONFIG.SYS is used by FreeDOS - RXCONFIG.SYS by RxDOS - CONFIG.PTS by PTS-DOS
In Windows 95 and Windows 98 (both DOS-based), CONFIG.SYS and AUTOEXEC.BAT files are present but generally contain minimal or no entries. Windows Me does not process CONFIG.SYS during startup; instead, it loads environment variables directly from the Windows Registry (HKLM\System\CurrentControlSet\Control\SessionManager\Environment).
Within the FlexOS operating system, CONFIG.SYS exists as a binary file responsible for defining resource managers and device drivers.
Example
Sample CONFIG.SYS 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 to serve as jump points for directives such as , , , , and .
- Functions similarly to , but also supports in-line comments following other CONFIG.SYS commands. Refer to for details. (In MS-DOS/PC DOS, inline comments are not disregarded if enclosed in double quotes.)
- Serves as a leading character for in-line comments together with the ; directive.
- Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands.[1] (FreeDOS does not allow custom messages but supports conditional execution with boot menus defined by and .) From DOS 6.0 onward, a comparable feature exists by appending after directives (e.g., ).
- Executes the next CONFIG.SYS directive unconditionally.
ATemplate:NbndC
- Determines whether programs can be interrupted upon encountering errors.
- Configures which drives record file access date stamps on FAT file systems.
- Enables conditional execution on AT-compatible hardware.
- Boot manager utility.
- Adjusts verbosity of error messages.
- Changes the default serial device driver assignment (COM1: through COM4:) associated with the AUX device.
- Restricts access to character devices outside the virtual \DEV directory.
- Loads a fundamental device driver into memory.
- Produces a beep sound even when notifications are disabled.
- Defines the subsequent operating system to boot.
- Enables or disables extended Ctrl+C checking functionality.
- Specifies how many disk buffers are allocated.
- Similar to BUFFERS but loads buffers into High Memory Area (HMA) or Upper Memory Blocks (UMB).
- , , (Embedded DOS 6-XL)
- Controls allocation and flushing timing of cache blocks.
- Loads programs within CONFIG.SYS and pauses further processing until they return.
- (DR-DOS 7.02+)
- Sets the Caps Lock status on the keyboard.
- , (PTS-DOS)
- Configures CD-ROM drivers and buffer sizes.
- (DR DOS 5.0+, Embedded DOS)
- Continues processing CONFIG.SYS from another file or label.
- , , and other PTS-DOS-specific directives manage hardware or user interface behavior.
- (OS/2)
- Specifies OEM code pages.
- , x=1..4 (DR-DOS 7.02+)
- Configures COM port count, sequence, I/O addresses, and timeouts.
- , (DOS 4.0+, RxDOS)
- Redefines characters used for inline comments or causes lines to be ignored.
This section details essential CONFIG.SYS directives that play a pivotal role in system configuration management across various DOS versions, emphasizing those affecting device drivers, memory handling, boot sequences, and user prompts—vital for optimizing legacy IT infrastructures.
DTemplate:NbndF
- Adjusts relocation parameters for drive descriptor tables.
- Defines the memory segment address limit up to which multi-sector disk data deblocking is permitted.
- Activates internal debugger support.
- Boot manager tool.
- Loads a device driver into system memory.
- Loads device drivers into upper memory area (equivalent to in DRDOS 5.0).
- Sets country and code page information for keyboard, screen, and printer devices.
- Configures sizes of cache memory allocations.
- Specifies compatibility mode for floppy disk drives.
- Determines display font used by the system.
- Controls loading of DOS into high memory and/or usage of upper memory blocks.
- Loads DOS tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory area.
- Sets alternative directory path for DOS files.
- Defines search paths for data files.
- Details physical parameters for disk drives.
- Establishes parameters for unrecognized or unknown drives.
- See .
- Enables error log generation with PDUMP.nnn files on specified drives.
- Outputs a message directly on screen during processing.
- Displays messages including ANSI escape sequences for enhanced formatting.
- Specifies additional verification steps when launching programs.
- Defines an assumed error or return code value.
- Sets A20 gate state upon program start-up.
- Terminates CONFIG.SYS processing prematurely except for SWITCHES and SHELL commands.
- Sets hash table size to accelerate file open operations (differs from MS-DOS/PC DOS FASTOPEN driver).
- Determines number of cached File Control Blocks (FCBs) that can be opened simultaneously (shares buffer with FILES in DR-DOS).
- Similar to FCBS but explicitly loads FCBs into upper memory area.
- Boot manager utility function.
- Specifies maximum number of files that can be opened concurrently.
- Similar to FILES but explicitly loads file handles into upper memory area.
- Includes execution of designated CONFIG.SYS subsections (refer to IGNORE).
GTemplate:NbndI
- Waits for a key press or timeout, then assigns the error level to the ASCII value received (or 1024 if timed out).
- Resumes processing of CONFIG.SYS at a specified label.
- Continues nested CONFIG.SYS execution at a designated label, with to return to the previous point.
- Refer to , , or for details.
- See also .
- Refer to .
- Consult or for additional information.
- See or for related usage.
- Refer to .
- Loads a terminate-and-stay-resident (TSR) program into memory after relocating the DOS data segment; compare with INSTCDEX.
- Consult , , or for further guidance.
- See also .
- Refer to or for more details.
- Activates console and command-line history buffers, enabling enhanced pattern searches.
- Defines the address of the High Memory Area (HMA) segment.
- Sets HLT mode for power-saving functionality.
- Enables scanning of boot sector viruses.
- Loads installable file system drivers.
- Prevents execution of particular CONFIG.SYS subsections.
- Permits certain programs to operate at ring 2, granting direct hardware I/O access.
- Incorporates directives from an alternate menu block (simulated via GOSUB/RETURN in DR-DOS).
- Sets the keyboard’s Insert mode status.
- Installs a TSR program into memory.
- Loads TSR software into upper memory, similar to HIINSTALL in DR DOS 5.0.
- Installs TSR after relocating the DOS data segment; see also INSTCDEX.
- Adjusts PIC interrupt priorities to assign highest priority to a specified IRQ.
KTemplate:NbndM
- Defines keyboard layout configuration.
- Sets the relocated keyboard buffer’s memory address.
- Specifies the maximum number of accessible drive letters.
- Functions like LASTDRIVE but loads Current Directory Structure (CDS) into upper memory.
- Lists directories searched for DLL files.
- Handles compatibility settings for legacy applications.
- Determines the quantity of file locks allowed.
- Configures boot logo display and startup messages using PTS-DOS boot manager.
- Defines count, order, I/O port address, and timeout parameters for LPT1 device.
- Mirrors LPT1 settings for LPT2 device configuration.
- Applies LPT1 parameters similarly to LPT3 device.
- Enables and configures LPT4 device with comparable settings.
- Establishes wait duration before increasing process priority.
- Configures memory allocation policies.
- Sets default strategy for DOS memory allocation.
- Specifies menu options available during boot or configuration.
- Defines menu color schemes (can be emulated in DR-DOS).
- Sets default menu block (emulatable in DR-DOS).
- Creates a menu block structure (emulated under DR-DOS).
- Enables multitrack disk read/write operations.
- Continues CONFIG.SYS processing from a new file after loading a device driver and setting the %NEWFILE% environment variable.
NTemplate:NbndQ
- Sets default character for No () responses in Yes/No/Resume prompts.
- Determines whether keyboard [[Num Lock|Template:Keypress]] is enabled or disabled at startup.
- Executes commands conditionally based on the last error code, e.g., .
- Displays a message and waits for key input, similar to and commands in DR-DOS environments.
- Requires user confirmation on errors encountered during CONFIG.SYS processing.
- Configures buffer size settings for LPT ports.
- Conditional execution limited to PC-compatible systems.
- Adjusts scheduler priority levels for processes.
- Sets priority for disk input/output operations programs.
- Changes default printer driver from LPT1 to either LPT3 or LPT4 devices.
- Determines whether DOS applications are permitted to run.
- Loads user interface components during boot or configuration phases.
- Conditional execution on IBM PS/1-compatible hardware platforms.
- Conditional execution on IBM PS/2-compatible hardware platforms.
- Suppresses output display directed to STDOUT.
RTemplate:NbndT
- Activates automatic system reboot upon encountering errors.
- Permits inclusion of comments within CONFIG.SYS (ignored in PTS-DOS).
- Allocates a drive letter reserved for local block device drivers.
- Sets the default character for Resume () prompts in Yes/No/Resume queries.
- Returns control from nested CONFIG.SYS processing back to the previous GOSUB or SWITCH location, optionally providing a return code.
- Defines the size of real mode memory available.
- Enables concurrent loading of programs within CONFIG.SYS (functionally similar to INSTALL under DOS).
- Saves the initial character of deleted files in the FAT reserved area.
- Determines video modes or methods for screen access.
- Controls the Scroll Lock key status on the keyboard.
- Establishes environment variables.
- Loads the command interpreter shell.
- Functions like SHELL but supports pre-allocating COMMAND.COM in HMA or UMBs to minimize fragmentation.
- Specifies keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
- Determines whether files close upon pressing Ctrl+Alt+Del.
- Indicates whether POST should be bypassed during reboot.
- , STACKSIZE, STACKSHIGH, STACK — Various legacy or compatibility stack settings across DOS variants.
- , SYSBOOT, SYSGEN, SYSLOAD — Parameters specific to PTS-DOS managing boot options and system memory layout.
- (DOS 6.0+) Defines submenu blocks (unsupported by DR-DOS or FreeDOS).
- , SWAPPATH, THREADS, TIMESLICE — OS/2-specific configurations for error logging, swap file paths, threading behavior, and CPU scheduling slices.
- , SWITCHES — Directives for conditional processing within CONFIG.SYS with differing support among DOS versions.
- , TMPEXT — Sets default switch characters ('/' or '-') and temporary file extensions respectively.
- , TRACEBUF — Enables single-step execution of CONFIG.SYS with configurable log buffer sizes (varies between DOS and OS/2).
- (OS/2 3.0+) Provides detailed error logging for diagnostic purposes.
UTemplate:NbndZ
- Assigns a specific segment as an upper memory block (UMB) for DOS usage.
- Configures the upper memory block server.
- Defines address ranges designated as UMB RAM.
- Enables or disables verification of disk writes.
- Specifies the DOS version reported to applications.
- Manages VGA display status settings.
- Sets the current video mode, akin to FreeDOS's SCREEN command functionality.
- Determines whether virtual DMA is permitted.
- Enables or disables processor Virtual Mode Extensions (VME).
- Configures VxD drivers utilized by Windows.
- Sets up Windows system support parameters.
- Controls relocation of the Extended BIOS Data Area (XBDA).
- Enables conditional execution on XT-compatible hardware platforms.
- Activates built-in Year 2000 compliance support.
- Defines the default 'Yes' character used in prompts.
- Manages deletion tracking features.
Issues
Although it is possible for the system to boot without a CONFIG.SYS file, this file—alongside AUTOEXEC.BAT—is critical for comprehensive operating system customization and meeting software prerequisites. Corruption or damage to these files requires troubleshooting intervention.
When CONFIG.SYS lacks a SHELL directive or is missing/corrupted altogether, 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 is absent, whereas MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later versions prompt users to specify an alternate command interpreter path. This prompt also appears if the primary shell terminates unexpectedly or exits intentionally, allowing limited runtime shell replacement without rebooting.
Due to incompatibilities between MS-DOS 7.0+ COMMAND.COM and DR-DOS, versions of DR-DOS from 7.02 onward restrict bypassing SHELL directives during skip/trace/step modes to avoid conflicts in dual-boot environments. Additional key combinations enable recovery from invalid SHELL arguments by requesting a valid shell filename before loading COMMAND.COM.
The maximum size allowed for CONFIG.SYS varies by operating system: MS-DOS and PC DOS limit it to approximately 64 KB, while DR-DOS imposes no size restriction beyond those inherent to the file system. MS-DOS processes CONFIG.SYS by compiling it into tokenized form executed in a fixed sequence—loading device drivers before TSRs—whereas DR-DOS interprets CONFIG.SYS line-by-line. This approach grants precise control over loading order via DEVICE and INSTALL directives, facilitating resolution of load conflicts and supporting conditional execution based on hardware presence, key presses, error conditions, or return codes. The INSTALL directive further allows integration of temporary external utilities into the CONFIG.SYS execution flow.
Limits on SHELL command line length have expanded over time: initially capped at 31 characters in MS-DOS/PC DOS versions 2.0 through 4.01, increasing up to 128 characters in later releases, with DR-DOS accommodating 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 a pre-existing DOS or Windows environment, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS respectively. This process enables dual boot functionality between Windows 9x and DOS. During a DOS startup, these files are temporarily restored to their original filenames. Meanwhile, backup copies of the Windows 95 versions are retained as CONFIG.W40 and AUTOEXEC.W40.
In cases where Caldera DR-DOS 7.02 or 7.03 coexists with Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT files remain unchanged, while DR-DOS employs DCONFIG.SYS and AUTODOS7.BAT for its boot configuration.
OS/2 and Windows NT
OS/2 extensively utilizes CONFIG.SYS for setting up drivers and environment parameters prior to launching its graphical user interface.
Within the OS/2 subsystem on Windows NT, the CONFIG.SYS file was presented to OS/2 applications but was actually maintained within the system registry.
Numerous CONFIG.SYS commands used by OS/2 are either undocumented or only partially described.
CONFIG.SYS remains in use among 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 Windows 98 / MS-DOS 7.10 CONFIG.SYS directives (archived)
- Caldera’s CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
- FreeDOS CONFIG.SYS directive explanations
- PTS-DOS 2000 Pro User Manual including CONFIG.SYS commands
- Unofficial German PTS-DOS FAQ (PTS/FAQD) featuring CONFIG.SYS directives
- ↑ Cite error: Invalid
<ref>tag; no text was provided for refs namedPaul_2000_CONFIG