DEVICE (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Operating system software |
| Founded | 1983 (with DOS version 2.0) |
| Products | Configuration directives for DOS and OS/2 |
CONFIG.SYS serves as the chief configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, holds setup instructions accessible to users that the operating system's DOS BIOS—typically found in IBMBIO.COM or IO.SYS—processes during the boot sequence. CONFIG.SYS made its debut with DOS version 2.0.
Usage
The directives within CONFIG.SYS tailor DOS to manage devices, applications, and memory management utilities. Once CONFIG.SYS is processed, DOS launches the command interpreter specified by the SHELL directive; if none is set, it defaults to COMMAND.COM, which subsequently runs AUTOEXEC.BAT.
This file mainly consists of name=value pairs that adjust configurable settings or load device drivers and terminate-and-stay-resident programs (TSRs) into memory.
Within DOS, CONFIG.SYS is located in the root directory of the bootable drive.
The same filename convention is employed by (DCP), an MS-DOS variant developed by East-German manufacturer VEB Robotron.
Certain DOS derivatives check for alternative filenames that take precedence over CONFIG.SYS:
- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 utilize CCONFIG.SYS instead of CONFIG.SYS. Some Multiuser DOS releases opt for CCONFIG.INI, whereas REAL/32 prioritizes MCONFIG.SYS. These systems maintain extended configuration data in binary files such as CCONFIG.BIN, typically edited through a utility named CONFIG.EXE.
- Starting with DR DOS 3.31 and including PalmDOS 1.0 and Novell DOS 7, DCONFIG.SYS supersedes CONFIG.SYS. Initially linked to disk compression utilities, this naming scheme also facilitates multi-boot setups.
- OpenDOS versions 7.01 and DR-OpenDOS 7.02 search for ODCONFIG.SYS, while some DR-DOS releases from 7.02 onward additionally look for DRCONFIG.SYS.
- Beginning with DR DOS 6.0, the SYS /DR:ext command enables renaming of system and configuration files to support multiple concurrent configurations within a single root directory, selectable via boot loaders like LOADER included with Multiuser DOS and DR-DOS 7.x.
- The SHELL command allows specifying alternative AUTOEXEC.BAT files using /P[:filename.ext], with COMMAND.COM accepting extensions other than .BAT in this context—a feature also supported by 4DOS.
- DR-DOS versions 6.0 and later include support for CHAIN=filespec, which continues processing another configuration file potentially located outside the root directory; from DR-DOS 7.02 onward, an optional label argument (CHAIN=filespec,label) enables jumping to specific sections within files.
- With DR-DOS 7.03 and newer, the SYS /A command copies both CONFIG.SYS and AUTOEXEC.BAT alongside system files.
Similar functionality appears in other DOS variants: FreeDOS uses FDCONFIG.SYS, RxDOS employs RXCONFIG.SYS, and PTS-DOS utilizes CONFIG.PTS.
Windows 95 and Windows 98, which are built on DOS foundations, include CONFIG.SYS and AUTOEXEC.BAT in their boot drive root directories but usually leave these files empty. In contrast, Windows Me does not parse CONFIG.SYS during startup; instead, it retrieves 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 specifying resource managers and device drivers loaded during system initialization.
Example
Here 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 destinations for , , , and commands.
- Functions similarly to , but can also be utilized for inline comments following other CONFIG.SYS lines. (Note: In MS-DOS/PC DOS, inline comments inside double quotes are not ignored.)
- Used at the start of inline comments alongside the ; directive.
- Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS instructions. (FreeDOS does not support custom messages but allows conditional execution via boot menus.) DOS version 6.0 and later provide a comparable feature by appending after directives (e.g., ).
- Executes the next CONFIG.SYS command without conditions.
ATemplate:NbndC
- Determines whether programs can be terminated upon encountering errors.
- Sets which drives maintain file access timestamps within FAT file systems.
- Enables conditional execution on AT-compatible hardware.
- Boot manager utility.
- Adjusts the detail level of error message reporting.
- Reassigns the default serial device driver from COM1: through COM4: for the AUX device.
- Prevents character devices from being accessible outside the virtual \DEV directory.
- Loads a fundamental device driver into memory.
- Produces a brief beep even if audible alerts are disabled.
- Defines the operating system to load next during boot.
- Enables or disables extended Ctrl+C checking functionality.
- Allocates a specified number of disk buffers.
- Similar to BUFFERS but loads buffers into High Memory Area or Upper Memory Blocks.
- Sets the maximum count of cache blocks assigned from system memory pool.
- Defines maximum duration before unused cache blocks return to system pool.
- Sets maximum time before modified cache blocks are written back to disk.
- Loads external programs within CONFIG.SYS, pausing processing until they complete.
- Specifies Caps Lock key status at startup (on or off).
- Identifies the CD-ROM hardware driver name.
- Determines number of buffers allocated for CD-ROM access.
- Continues processing CONFIG.SYS from another file or label.
- Defines the system clock type in use.
- Clears the display screen.
- Sets OEM codepage(s).
- Specifies CMOS RAM address location.
- Sets color schemes for boot menu displays.
- Configures count, sequence, I/O address, and timeout settings for COM1 port device.
- ... ; similar configurations apply for COM2, COM3, and COM4 ports.
[Additional entries omitted for brevity]
DTemplate:NbndF
- Manages relocation of drive descriptor tables in memory.
- Sets memory segment address used for multi-sector disk data deblocking operations.
- Activates internal debugger support features.
- Boot manager tool.
- Loads a device driver into conventional memory space.
- Loads a device driver into upper memory (equivalent to in DRDOS 5.0).
- Configures country-specific and codepage information for keyboard, screen, and printer devices.
- Adjusts sizes of cache memory allocations.
- Defines compatibility mode settings for floppy disk drives.
- Specifies display font parameters.
- Controls loading DOS into high memory and/or utilizing upper memory blocks.
- Loads DOS system tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory area.
- Sets an alternative search path for DOS system files.
- Defines search paths for data files used by DOS utilities.
- Specifies physical disk drive characteristics and parameters.
- Establishes parameters for drives that are not otherwise recognized by the system.
- See .
- Enables error logging with
PDUMP.nnnfiles on specified drives. - ; Displays a message on screen during boot or processing stages.
- ; Displays messages including ANSI escape sequences for formatting control.
- ; Adds extra validation checks when launching programs.
- ; Indicates assumed error or return codes during subsequent processing steps.
- ; Sets A20 gate state when starting applications to control address line behavior.
- ; Terminates CONFIG.SYS processing before reaching file end (excluding certain SWITCHES and SHELL commands).
- ; Defines hash table size utilized to speed up file open operations (distinct from MS-DOS/PC DOS FASTOPEN driver).
- ; Specifies 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 area.
- ; Boot manager utility function.
- ; Defines maximum number of files that can be open at once by DOS.
- ; Similar to FILES but loads file handles explicitly into upper memory blocks.
- ; Includes execution of specified CONFIG.SYS subsections (refer 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 a designated label.
- Continues nested CONFIG.SYS processing at a specified label, then returns to the prior point.
- Refer to , , or for additional details.
- See related commands .
- Consult for further information.
- Related commands include and .
- See also and for context.
- Additional information available in .
- Loads a TSR (Terminate and Stay Resident) program into memory following DOS data segment relocation. Compare with INSTCDEX.
- Refer to , , or for related functionality.
- See additional commands .
- Consult and for related uses.
- Activates and configures the console and command line history buffer, featuring advanced pattern search capabilities.
- Defines the address of the High Memory Area (HMA) segment.
- Configures the HLT instruction for power-saving mode.
- Enables scanning of boot sectors for viruses during startup.
- Loads installable file system drivers.
- Omits execution of specified CONFIG.SYS sections (also see ).
- Permits certain applications to execute at ring 2, allowing direct hardware I/O operations.
- Imports directives from another menu block, emulated via GOSUB/RETURN in DR-DOS.
- Sets the status of keyboard Insert mode.
- Installs a TSR program into memory residency.
- Loads TSR programs into upper memory areas (equivalent to HIINSTALL in DR DOS 5.0).
- Installs TSR programs after relocating the DOS data segment (see also INSTCDEX).
- Adjusts PIC interrupt priorities to assign highest priority to a chosen IRQ line.
KTemplate:NbndM
- Defines keyboard layout settings.
- Specifies the memory address of the relocated keyboard buffer.
- Sets the maximum number of accessible drive letters.
- Similar to LASTDRIVE but additionally loads Current Directory Structure (CDS) into upper memory regions.
- Establishes search paths for dynamic link libraries (DLLs).
- Provides compatibility adjustments for legacy software.
- Configures the number of allowable file locks simultaneously.
- Manages boot logo display options using the PTS-DOS boot manager.
- Sets parameters including count, order, I/O address, and timeout for the LPT1 parallel port device.
- Applies identical configuration as LPT1 for LPT2 device settings.
- Mirrors LPT1 configuration for LPT3 device usage.
- Enables and configures LPT4 device similarly to other parallel ports.
- Defines wait duration before elevating process priority levels.
- Controls strategies for memory allocation within DOS environment.
- Specifies default methods used by DOS for allocating memory resources.
- Defines options available within menu systems.
- Sets color schemes for menus, with emulation support in DR-DOS environments.
- Determines default menu block selection, emulatable in DR-DOS systems.
- Creates menu blocks emulated by DR-DOS implementations.
- Activates support for multitrack disk operations.
- Continues CONFIG.SYS processing from an external file, optionally loading a device driver and setting the %NEWFILE% environment variable.
NTemplate:NbndQ
- Defines default response character for No () in Yes/No/Resume prompts.
- Controls the state of keyboard [[Num Lock|Template:Keypress]], enabling or disabling it at startup.
- Allows conditional execution based on previous error code results, e.g., .
- Displays a message and waits for user keypress, similar to commands found in DR-DOS systems.
- Requires user confirmation on error occurrences within CONFIG.SYS processing.
- Configures buffer sizes allocated to LPT parallel ports.
- Enables conditional execution tailored for PC-compatible hardware platforms.
- Sets priority levels within process scheduling mechanisms.
- Adjusts priority assigned to disk input/output operations.
- Changes default printer driver assignment among LPT1 through LPT4 devices.
- Controls whether DOS-based applications are permitted to execute on the system.
- Loads a user interface shell environment during startup sequences.
- Conditional execution directive specific to IBM PS/1 compatible machines.
- Conditional execution directive specific to IBM PS/2 compatible machines.
- Suppresses output display directed to standard output (STDOUT).
RTemplate:NbndT
- Activates automatic system reboot upon encountering errors.
- Permits inclusion of comments within CONFIG.SYS files.
- Allocates a drive letter for local device drivers.
- Defines the default Resume () character used in command prompts.
- Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH point, optionally passing a return code.
- Sets the size of real mode memory available.
- Enables simultaneous loading of programs in CONFIG.SYS running in the background, functioning similarly to CALL or INSTALL commands in DOS.
- Controls whether the first character of deleted file names is retained in FAT directory entries.
- Determines video mode settings under FreeDOS or screen access methods under PTS-DOS.
- Toggles the keyboard Scroll Lock state on or off.
- Assigns environment variables.
- Loads the command interpreter shell.
- Functions like SHELL but includes a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMB areas, enhancing memory management when using third-party shells.
- Sets keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
- Specifies whether files are closed during Ctrl+Alt+Del initiated reboots.
- Bypasses POST during reboot sequences.
- , STACKSIZE, STACKSHIGH
- Configure stack parameters across diverse DOS variants and embedded systems, influencing hardware interrupt processing and memory allocation for threads or buffers.
- , SYSBOOT, SYSGEN, SYSLOAD
- PTS-DOS-specific commands managing boot options, system memory layout, and alternative operating system loading paths.
- , SWITCH
- Defines submenu blocks or enables conditional nested CONFIG.SYS processing with label-based branching to allow flexible startup configurations (not supported by all DOS versions).
- , SWAPPATH
- OS/2 directives that specify drive locations for error logs and paths for swap files.
- , SWITCHES
- Sets default switch characters ('/' or '-') and designates special options for command-line parsing across various DOS implementations.
- , THREADS, TIMESLICE
- OS/2 parameters controlling FPU bug fixes, number of concurrent threads, and scheduler time slice durations for performance optimization.
- , TRACE, TRACEBUF
- Configure timeouts for CONFIG.SYS commands, enable single-step execution tracing, and set buffer sizes for trace logs on DR-DOS, PTS-DOS, FreeDOS, and OS/2 platforms to aid debugging.
- , TRAPDUMP
- Defines temporary file extensions (PTS-DOS) and detailed error logging options (OS/2) to assist with system diagnostics and maintenance.
UTemplate:NbndZ
- Directs DOS to use a specified segment as Upper Memory Block (UMB).
- Sets which UMB server is utilized.
- Identifies address ranges designated as UMB RAM.
- Enables or disables verification of disk writes.
- Determines the DOS version reported to applications.
- Configures VGA display status settings.
- Specifies the active video mode.
- Enables virtual DMA functionality.
- Manages activation of processor Virtual Mode Extensions (VME).
- Configures VxD driver support for Windows environments.
- Sets Windows system support parameters.
- Controls relocation of the Extended BIOS Data Area (XBDA).
- Allows conditional execution on XT-compatible machines.
- Enables built-in Year 2000 compliance support.
- Defines the default Yes character used in prompts.
- Manages tracking of file deletions.
Issues
Although the system is capable of booting without CONFIG.SYS or AUTOEXEC.BAT, these configuration files are vital for complete operating system customization and meeting software prerequisites. When these files are corrupted or missing, diagnostic efforts become necessary.
In the absence of a SHELL directive in CONFIG.SYS—or if the file is damaged or absent—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, and Novell DOS 7 or later, the system prompts for an alternative command processor path when COMMAND.COM is missing or terminates unexpectedly, allowing for limited runtime shell substitution.
Due to incompatibilities between MS-DOS 7+ COMMAND.COM and DR-DOS, versions 7.02 and above of DR-DOS enforce SHELL directives during skip, trace, or step modes. This enforcement requires users to specify a valid shell file before loading COMMAND.COM from the root directory.
The maximum size allowed for CONFIG.SYS varies by system: MS-DOS and PC DOS impose limits (recent versions support up to 64 KB), whereas DR-DOS permits an unrestricted size constrained only by the underlying file system. MS-DOS converts CONFIG.SYS into a tokenized format and processes commands sequentially, loading device drivers prior to TSR programs. Conversely, DR-DOS interprets each directive individually, granting users precise control over load order through DEVICE and INSTALL commands. This approach facilitates resolution of load order conflicts and supports integration of non-resident utilities.
The length limit for the SHELL command line in MS-DOS/PC DOS versions 2.0 through 4.01 is capped at 31 characters; this was extended to 128 characters in subsequent releases. DR-DOS allows up to 255 characters for this line. It is important to note that none of the CONFIG.SYS directives support long filenames.
Dual booting DOS and Windows 9x
When Windows 95 is installed over an existing DOS/Windows environment, CONFIG.SYS and AUTOEXEC.BAT are renamed to CONFIG.DOS and AUTOEXEC.DOS respectively, enabling dual-boot functionality. Booting into DOS temporarily restores these original filenames, while Windows 95 configuration files are saved as CONFIG.W40 and AUTOEXEC.W40.
In contrast, installing Caldera DR-DOS versions 7.02 or 7.03 alongside Windows 95 retains the Windows CONFIG.SYS and AUTOEXEC.BAT filenames unchanged; DR-DOS uses its own startup files named DCONFIG.SYS and AUTODOS7.BAT.
OS/2 / Windows NT
OS/2 relies heavily on CONFIG.SYS for configuring system settings, loading drivers, and establishing environment variables before launching its graphical user interface.
Within the OS/2 subsystem under Windows NT, CONFIG.SYS appears identically to OS/2 applications but is actually maintained within the Windows registry.
Numerous undocumented CONFIG.SYS directives exist specifically for OS/2 systems.
CONFIG.SYS continues to be a fundamental component 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
- 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
- FreeDOS CONFIG.SYS directive descriptions
- PTS-DOS 2000 Pro User Manual with CONFIG.SYS directives (archived)
- Unofficial German PTS-DOS FAQ (archived) including CONFIG.SYS information