CLS (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Computer software |
| Founded | 1983 |
| Products | System configuration commands for DOS and OS/2 |
CONFIG.SYS serves as the main configuration file utilized by DOS and OS/2 operating systems. This plain-text ASCII file holds configuration commands accessible to users, which the OS's DOS BIOS—commonly found in IBMBIO.COM or IO.SYS—interprets during system startup. The introduction of CONFIG.SYS dates back to DOS version 2.0.
Usage
The directives within CONFIG.SYS are responsible for setting up DOS to handle hardware devices, software applications, and memory allocation. Once CONFIG.SYS processing concludes, DOS initiates the command interpreter defined by the SHELL instruction; if unspecified, it defaults to COMMAND.COM, which subsequently executes AUTOEXEC.BAT.
CONFIG.SYS primarily comprises name=value pairs that adjust system parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs). Typically, this file is located in the root directory of the boot drive in DOS environments.
The same filename is also employed by (DCP), an MS-DOS variant developed by the East-German firm VEB Robotron.
Certain DOS variants check for alternative configuration filenames that override CONFIG.SYS:
- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 prioritize CCONFIG.SYS or CCONFIG.INI, with extended settings stored in CCONFIG.BIN, which can be modified using CONFIG.EXE.
- In DR DOS version 3.31 and later releases—including PalmDOS 1.0 and Novell DOS 7—DCONFIG.SYS takes precedence. This facilitates scenarios such as disk compression where drive letters are remapped during boot, supporting multi-boot setups.
- OpenDOS versions 7.01 and DR-OpenDOS 7.02 also detect ODCONFIG.SYS, while some DR-DOS variants look for DRCONFIG.SYS.
Starting with DR DOS 6.0, users can alter default system file extensions via SYS /DR:ext, allowing multiple system files to coexist in a single root directory, selectable through boot loaders like LOADER. The SHELL command permits specifying alternative AUTOEXEC.BAT files using /P[:filename.ext], a feature also recognized by enhanced shells such as 4DOS. Additionally, the CHAIN=filespec directive enables continuation of configuration parsing from other files, optionally jumping to specified labels.
From DR-DOS 7.03 onward, the command SYS /A copies CONFIG.SYS and AUTOEXEC.BAT alongside system files.
Other operating systems use similar alternate filenames: FDCONFIG.SYS in FreeDOS, RXCONFIG.SYS in RxDOS, and CONFIG.PTS in PTS-DOS.
Both CONFIG.SYS and AUTOEXEC.BAT exist on the root directory of Windows 95 and 98 boot drives but are usually left empty. In contrast, Windows Me bypasses parsing CONFIG.SYS during startup, opting instead to load environment variables from the Windows Registry.
Within the FlexOS operating system, CONFIG.SYS is formatted as a binary file that specifies resource managers and device drivers to be loaded during boot.
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>
:;*?!
- Acts as label markers within CONFIG.SYS, serving as jump points for , , , , and directives.
- Functions similarly to , additionally used to insert inline comments following other CONFIG.SYS commands. Note that under MS-DOS/PC DOS, inline comments enclosed in double quotes are not ignored.
- Introduces inline comments alongside the ; directive.
- Prompts the user with a Yes/No confirmation before executing subsequent CONFIG.SYS instructions. FreeDOS offers optional conditional support via boot menus but does not display messages. Starting with DOS 6.0, a comparable feature exists using a trailing after commands.
- Forces unconditional execution of the next CONFIG.SYS directive.
ATemplate:NbndC
- Determines whether programs may be terminated upon encountering errors.
- Sets which drives record file access timestamps within FAT file systems.
- Enables conditional execution on AT-compatible hardware.
- Acts as a boot manager utility.
- Adjusts the level of detail in error message output.
- Changes the default serial driver assigned to the AUX device.
- Prevents character devices from being accessible outside the phantom \DEV directory.
- Loads the fundamental device driver into system memory.
- Produces a beep sound even if audible alerts are disabled.
- Specifies the operating system to boot next in sequence.
- Enables or disables extended Ctrl+C signal checking.
- Defines the quantity of disk buffers to allocate.
- Similar to BUFFERS but allocates buffers in HMA or UMB memory areas.
- , , (Embedded DOS 6-XL exclusive)
- Controls cache block allocation and timing for flushing operations.
- Loads programs listed in CONFIG.SYS and pauses further processing until they return control.
- Sets the keyboard’s Caps Lock status on startup.
- , (PTS-DOS specific)
- Assigns CD-ROM hardware driver name and buffer settings.
- Continues CONFIG.SYS processing from a specified file or label.
- , , and additional PTS-DOS directives manage system clock type, screen clearing, color schemes, and other customization options primarily for system tailoring purposes.
- , , and related commands enable internationalization support and OEM codepage configurations across various DOS platforms.
Additional directives concerning COM ports (COM1–COM4), CPU-specific conditions (CPU386, CPU486+), and device driver settings are variably implemented across DOS versions, focusing on hardware compatibility and optimizing system performance.
DTemplate:NbndF
- Configures relocation of drive descriptor tables in memory.
- Defines memory segment address used for multi-sector disk data deblocking.
- Activates internal debugger capabilities.
- Functions as a boot manager component.
- Loads device drivers into conventional memory space.
- Loads device drivers into upper memory blocks (equivalent to in DRDOS 5.0).
- Sets country-specific and codepage parameters for keyboard, screen, and printer devices.
- Adjusts sizes of cache memory allocations.
- Specifies compatibility mode for floppy disk drives.
- Determines display font selection.
- Controls whether DOS loads into high memory or utilizes upper memory areas (similar to in DRDOS 5.0).
- Loads DOS internal tables such as BUFFERS, FCBS, FILES into upper memory segments.
- Specifies an alternative directory path for DOS system files.
- Defines search paths for locating data files.
- Configures physical parameters of disk drives.
- Sets parameters for unrecognized or non-standard drives.
- See .
- Enables creation of PDUMP.nnn error logs and specifies target drive for storage.
- Outputs a message to the display screen.
- Displays messages that include ANSI escape sequences for formatting.
- Controls additional validation checks when executing programs.
- Indicates expected error or return code values.
- Sets A20 gate status during program startup sequences.
- Terminates CONFIG.SYS processing early except for certain critical directives.
- Defines hash table size for accelerated file opening operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
- Specifies number of cached File Control Blocks (FCBs) that can be open simultaneously (shared buffer with FILES under DR-DOS).
- Similar to FCBS but loads FCBs into upper memory area instead of conventional memory.
- Boot manager functionality included here as well.
- Defines maximum number of files that can be opened concurrently by the system.
- Similar to FILES directive but loads file handles into upper memory blocks for optimization.
- Facilitates 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 CONFIG.SYS processing at a designated label.
- Continues nested CONFIG.SYS processing at a specified label, returning afterwards to the prior point.
- Refer to , , or for related information.
- See further details in .
- Consult for additional context.
- Refer to or for more information.
- See or for related commands.
- Consult for further usage.
- Loads a Terminate and Stay Resident (TSR) program into memory following DOS data segment relocation. Compare with INSTCDEX.
- Refer to , , or for related instructions.
- See additional details in .
- Consult or for further reference.
- Activates console and command line history buffers with advanced pattern searching capabilities.
- Defines the High Memory Area (HMA) segment address.
- Configures the CPU's HLT power-saving mode.
- Enables scanning of the boot sector for viruses.
- Loads installable file system drivers.
- Omits execution of certain subsections within CONFIG.SYS.
- Permits selected programs to operate at ring 2, allowing direct hardware input/output access.
- Includes directives from an alternate menu block (emulated via GOSUB/RETURN in DR-DOS).
- Sets the Insert mode status on the keyboard.
- Installs a TSR program into memory.
- Installs TSR programs into upper memory, equivalent to HIINSTALL in DR DOS 5.0.
- Loads TSRs after relocating the DOS data segment (compare INSTCDEX).
- Adjusts PIC interrupt priorities to assign highest priority to a specified IRQ number.
KTemplate:NbndM
- Defines the keyboard layout configuration.
- Specifies the address location of the relocated keyboard buffer.
- Sets the maximum number of accessible drives.
- Similar to LASTDRIVE but loads Current Directory Structure (CDS) into upper memory space.
- Establishes paths for DLL searches.
- Provides compatibility settings for legacy software applications.
- Configures the number of permitted file locks.
- Manages boot logo display and startup message settings via PTS-DOS boot manager.
- Defines parameters including count, logical order, I/O address, and timeout duration for LPT1 device configuration.
- Configures LPT2 device with similar parameters.
- Applies comparable settings to LPT3 device configuration.
- Enables and sets up LPT4 device functionality.
- Determines wait time before increasing process priority levels.
- Sets memory allocation policies and strategies.
- Specifies the default strategy for DOS memory allocation operations.
- Defines menu option parameters.
- Sets menu color schemes (emulatable within DR-DOS).
- Specifies default menu block (can be emulated in DR-DOS).
- Defines multiple menu blocks (emulatable in DR-DOS).
- Enables multitrack disk drive operations support.
- Continues CONFIG.SYS processing from a separate file, optionally after loading a device driver and assigning the %NEWFILE% environment variable.
NTemplate:NbndQ
- Defines the default No () character used in Yes/No/Resume prompts.
- Controls keyboard [[Num Lock|Template:Keypress]] state, turning it on or off.
- Enables conditional execution based on the most recent error code, e.g., .
- Displays a message and waits for a key press, similar to and commands in DR-DOS environments.
- Requires user confirmation upon encountering errors within CONFIG.SYS processing.
- Sets buffer sizes allocated for LPT ports.
- Enables conditional execution on PC-compatible systems.
- Adjusts task scheduler priority levels.
- Modifies priority settings specifically for disk I/O related programs.
- Changes default printer device driver assignment (e.g., switching from LPT1 to LPT3 or LPT4).
- Controls whether DOS applications are permitted to execute.
- Loads a user interface shell environment.
- Enables conditional execution on IBM PS/1-compatible hardware platforms.
- Allows conditional execution on IBM PS/2-compatible systems.
- Suppresses output display directed to STDOUT.
RTemplate:NbndT
- Activates automatic system reboot upon encountering errors.
- Permits inclusion of comments within CONFIG.SYS files.
- Allocates drive letters for local block device drivers.
- Sets the default Resume () character displayed in command prompts.
- Returns control from nested CONFIG.SYS processing to the prior GOSUB or SWITCH point, optionally passing a return code.
- Specifies 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 DOS/OS2 environments.
- Determines whether the first character of deleted files is preserved in FAT directory entries.
- Defines video display modes for FreeDOS or screen access methods under PTS-DOS.
- Controls the state of the keyboard Scroll Lock key, enabling it to be turned on or off.
- Establishes environment variables.
- Loads the command interpreter shell.
- Functions like SHELL but supports a size parameter to pre-allocate COMMAND.COM into HMA or UMBs, enhancing memory efficiency when using third-party shells.
- Sets keyboard modifier keys such as Shift Lock, Num Lock, Scroll Lock, and Insert mode states.
- Determines whether files are closed upon pressing Ctrl+Alt+Del.
- Skips the Power-On Self Test (POST) during reboot sequences.
- , STACKSIZE, STACKSHIGH
- Various parameters controlling stack configuration across different DOS versions, influencing interrupt handling and memory allocation. Some are ignored in newer releases or specific operating systems.
- , SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
- Parameters specific to PTS-DOS that manage boot options, system memory mapping, and loading DOS components into upper memory blocks (UMBs).
- , SWITCH, SWITCHES
- Directives that govern control flow within nested CONFIG.SYS processing, allowing conditional branching based on key presses or configured options. Availability varies among DOS variants.
- , SWAPPATH
- OS/2 configuration parameters defining locations for error logs and swap file storage paths.
- , THREADS, TIMESLICE
- OS/2-specific settings that adjust floating-point unit bug fixes, the number of concurrent threads allowed, and scheduler time slice durations.
- , TRACE, TRACEBUF
- Parameters used across DR-DOS, PTS-DOS, FreeDOS, and OS/2 to manage timing and debugging logs during CONFIG.SYS execution.
- , TRAPDUMP
- Settings for PTS-DOS and OS/2 that specify temporary file extensions and detailed error logging behavior.
UTemplate:NbndZ
- Configures DOS to utilize a designated segment as Upper Memory Block (UMB) space.
- Specifies which UMB server is employed by the system.
- Defines address ranges allocated for UMB RAM usage.
- Enables or disables verification of disk writes.
- Sets the DOS version string reported to applications.
- Configures VGA display settings status.
- Indicates the current video mode in use.
- Enables or disables use of virtual DMA capabilities.
- Controls whether Virtual Mode Extensions on the processor are disabled.
- Sets up VxD driver configurations for Windows environments.
- Establishes system support parameters for Windows operation.
- Manages relocation settings for the Extended BIOS Data Area (EBDA).
- Provides conditional execution options tailored for XT-compatible machines.
- Enables built-in Year 2000 (Y2K) compliance support features.
- Defines the default 'Yes' character used in prompt responses.
- Configures tracking behavior for file deletions.
Issues
Although booting can occur without CONFIG.SYS or AUTOEXEC.BAT files present, these configuration files are vital for complete DOS customization and meeting application demands. Corruption or damage necessitates troubleshooting efforts.
If the SHELL directive is absent from CONFIG.SYS or if the file is missing or corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to DOS 6.0 will fail to boot if COMMAND.COM is not found. Starting with MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 or later, users receive a prompt requesting a path to a command processor when none is found or if the primary shell terminates unexpectedly. This mechanism allows limited replacement of the shell at runtime without requiring a system reboot.
COMMAND.COM from MS-DOS version 7.0 onward is incompatible with DR-DOS but is commonly present on C:\ drives in dual-boot configurations. DR-DOS versions 7.02 and later prevent bypassing SHELL directives during skip/trace/step modes to avoid conflicts with incompatible shells. Users are prompted to provide a valid shell filename before COMMAND.COM is loaded.
CONFIG.SYS file size constraints vary depending on the operating system: recent MS-DOS and PC DOS versions permit up to 64 KB, whereas DR-DOS imposes no practical limit since it processes directives line by line instead of compiling them into memory tokens. This approach facilitates flexible ordering of device drivers and TSRs via DEVICE and INSTALL commands, aiding in conflict resolution and allowing temporary software integration during system startup.
Limits on shell command line length also differ: MS-DOS and PC DOS versions from 2.0 through 4.01 allow up to 31 characters, later releases increase this limit to 128 characters, while DR-DOS supports command lines up to 255 characters. It should be noted that CONFIG.SYS directives do not accept 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, enabling dual boot functionality between DOS and Windows 9x. During a DOS boot session, these files temporarily assume the names CONFIG.SYS and AUTOEXEC.BAT. Meanwhile, backup copies of the Windows 95 variants are preserved as CONFIG.W40 and AUTOEXEC.W40.
In contrast, installing Caldera DR-DOS versions 7.02 or 7.03 alongside Windows 95 does not alter the original Windows CONFIG.SYS or AUTOEXEC.BAT files. Instead, DR-DOS employs uniquely named startup files: DCONFIG.SYS and AUTODOS7.BAT.[1]
OS/2 / Windows NT
OS/2 depends extensively on CONFIG.SYS to set up device drivers and environment parameters before its graphical user interface initializes.
Within the OS/2 subsystem of Windows NT, the CONFIG.SYS file accessed by OS/2 applications is actually maintained within the system registry rather than as a conventional file.
There are numerous CONFIG.SYS commands in OS/2 that remain undocumented.[2]
CONFIG.SYS continues to play a vital role in OS/2-based systems such as eComStation[3] and ArcaOS.[4]
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 CONFIG.SYS directives for Windows 98 / MS-DOS 7.10 (archived)
- Caldera's CONFIG.SYS Command Reference (archived) – Guide to DR-DOS 7 directives
- FreeDOS CONFIG.SYS directive descriptions (archived)
- PTS-DOS 2000 Pro User Manual featuring CONFIG.SYS commands (archived)
- Unofficial German PTS-DOS FAQ (PTS/FAQD) with extended CONFIG.SYS directives (archived)
- ↑ Cite error: Invalid
<ref>tag; no text was provided for refs namedCaldera_1998_USER - ↑ Cite error: Invalid
<ref>tag; no text was provided for refs namedChilds_1995_OS2 - ↑ Cite error: Invalid
<ref>tag; no text was provided for refs namedecom_2001 - ↑ Cite error: Invalid
<ref>tag; no text was provided for refs namedArcaOS_2020