Jump to content

SWITCHES (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article SWITCHES (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983
ProductsSystem configuration 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 user-editable instructions that the operating system's DOS BIOS—typically found in IBMBIO.COM or IO.SYS—interprets during the startup sequence. The CONFIG.SYS file was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS tailor DOS settings for hardware devices, software applications, and memory management utilities. Once CONFIG.SYS has been processed, DOS launches the command interpreter specified on the SHELL line; if none is provided, it defaults to COMMAND.COM. Subsequently, the interpreter executes commands from the AUTOEXEC.BAT script.

CONFIG.SYS primarily contains name=value statements that configure system parameters or load components such as device drivers and terminate-and-stay-resident (TSR) programs. On DOS systems, this configuration file is located in the root directory of the boot disk.

Certain DOS variants allow alternative filenames to override CONFIG.SYS:

- Advanced editions like Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI instead, with settings saved in CCONFIG.BIN and managed via CONFIG.EXE. - Versions including DR DOS 3.31, PalmDOS 1.0, and Novell/OpenDOS prioritize DCONFIG.SYS over CONFIG.SYS to support features like disk compression and multi-boot configurations. - OpenDOS releases 7.01 and DR-OpenDOS 7.02 recognize ODCONFIG.SYS, while some DR-DOS versions from 7.02 onward look for DRCONFIG.SYS. - Starting with DR-DOS 6.0, users can modify default system file extensions using SYS /DR:ext, allowing multiple distinct sets of system files to coexist and be selected through boot managers such as LOADER. - The SHELL command can specify alternate AUTOEXEC.BAT files using the /P[:filename.ext] option; in this mode, COMMAND.COM accepts script files with extensions other than .BAT. - DR-DOS includes a CHAIN=filespec directive that enables sequential processing of additional configuration files, optionally targeting specific sections via labels. - From DR-DOS 7.03 onward, the SYS /A command copies both CONFIG.SYS and AUTOEXEC.BAT alongside system files.

Other DOS-based systems offer comparable functionality: FreeDOS uses FDCONFIG.SYS, RxDOS employs RXCONFIG.SYS, and PTS-DOS utilizes CONFIG.PTS.

In Windows 95 and 98 environments—both built on DOS—CONFIG.SYS and AUTOEXEC.BAT files exist but are frequently left blank. Windows Me omits parsing CONFIG.SYS during startup entirely, instead loading environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

Unlike these text-based configurations, under FlexOS, CONFIG.SYS is a binary file that specifies resource managers and device drivers loaded during boot.

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 used as jump destinations by , , , , and commands.
Functions similarly to , but permits inline comments following other directives in CONFIG.SYS. (Note that in MS-DOS/PC DOS, inline comments inside double quotes are not ignored.)
Allows inline commentary alongside the ; directive.
Prompts with a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS does not support custom messages here but allows conditional execution through boot menus.)
Executes the next CONFIG.SYS instruction without condition.

ATemplate:NbndC

Determines whether programs can be interrupted upon encountering errors.
Defines which drives record file access timestamps in FAT file systems.
Enables conditional execution on AT-compatible hardware.
Manages boot operations.
Adjusts the verbosity level of error messages.
Changes the default serial driver assigned to the AUX: device.
Prevents access to character devices outside the virtual \DEV directory.
Loads the fundamental device driver into system memory.
Produces a brief beep sound even when notifications are turned off.
Indicates the subsequent operating system to boot.
Enables or disables extended Ctrl+C detection.
Sets the quantity of disk buffers allocated.
Similar to BUFFERS but allocates buffers within HMA or UMB.
, CACHETTL, CACHEFLUSH (Embedded DOS 6-XL only)
Adjust cache allocation parameters and timing settings.
Executes programs listed in CONFIG.SYS, pausing further processing until completion.
Sets the keyboard’s Caps Lock state.
, CDDBUFFERS (PTS-DOS only)
Configures CD-ROM driver parameters and buffer sizes.
Continues processing CONFIG.SYS from another file or label.
, CLS, CODEPAGE (various OS-specific)
Manage system clock type, clear screen command, and OEM codepage settings.
, COM2, COM3, COM4 (DR-DOS 7.02+)
Configure serial communication ports including count, sequence, I/O addresses, and timeout values.
, COMMENT(S), COUNTRY (various OS-specific)
Define DMA buffer usage, inline comment handling, and internationalization support.
, CPSW (MS-DOS specific)
Provides cursor positioning and codepage switching features.
, CPU88, CPU86, CPU286, CPU386, CPU486 (PTS-DOS and DR-DOS)
Execute conditionally depending on CPU model or clock speed.

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Specifies memory segment for multi-sector disk data buffering and deblocking.
Activates internal debugger functionality.
Boot management utility.
Loads device drivers into conventional memory space.
Loads device drivers into upper memory blocks (equivalent to in DRDOS 5.0).
Sets country and codepage configurations for keyboard, screen, and printer devices.
Defines sizes for cache memory allocation.
Specifies compatibility mode for floppy disk drives.
Selects display font type.
Controls loading of DOS into high memory and utilization of upper memory areas.
Loads DOS internal tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory regions.
Designates an alternative directory path for DOS files.
.
Sets search paths for data files used by the system.
Defines physical characteristics of disk drives connected to the system.
Provides parameters for unknown or unrecognized drives.
Refer to .
Enables a drive dedicated to storing PDUMP.nnn error log files.
Displays a message on the screen during processing.
Shows messages containing ANSI escape sequences for formatting.
Applies additional validation checks when launching programs.
Defines assumed error or return codes for processes.
Manages the A20 line gate state upon program initiation.
Terminates CONFIG.SYS parsing prematurely except for certain directives that must run last.
Configures hash table size to accelerate file opening operations, differing from MS-DOS FASTOPEN driver behavior.
Determines the number of cached File Control Blocks open simultaneously (shares buffer space with FILES under DR-DOS).
Similar to FCBS but loads these structures into upper memory blocks.
Boot management utility feature.
Sets maximum number of concurrently open files allowed by the system.
Like FILES but loads file handle tables into upper memory areas.
Supports inclusion of specified CONFIG.SYS subsections during execution (refer to IGNORE directive).

GTemplate:NbndI

Pauses for a key press (or timeout) and assigns error level to the key's ASCII value (or 1024 if timed out).
Resumes processing of CONFIG.SYS at a specified label.
Continues nested CONFIG.SYS execution at a designated label, then returns to the prior location.
Refer to , , or for additional details.
Consult documentation for further information.
See related commands in .
Refer to or for more context.
Consult or for extended details.
Refer to documentation.
Loads a TSR program into memory similarly to , but after relocating the DOS data segment. Compare with INSTCDEX.
See , , or for related functions.
Consult documentation.
Refer to or for additional information.
Activates console and command line history buffer with advanced pattern matching capabilities.
Defines the HMA segment address.
Configures HLT-based power-saving modes.
Sets system checks for boot sector virus presence.
Loads installable file system drivers.
Prevents execution of specified CONFIG.SYS subsections.
Permits certain programs to operate at ring 2, allowing direct hardware access.
Incorporates directives from another menu block (simulated through GOSUB/RETURN in DR-DOS).
Sets the keyboard's Insert mode status.
Installs a TSR program into memory.
Loads TSR program into upper memory area (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSR after relocating DOS data segment. Compare with INSTCDEX.
Adjusts PIC interrupt priorities, assigning highest priority to the specified IRQ.

KTemplate:NbndM

Determines the keyboard layout configuration.
Specifies the relocated keyboard buffer’s memory address.
Defines the maximum number of accessible drives.
Functions like LASTDRIVE but loads Current Directory Structure (CDS) into upper memory area.
Sets paths for DLL file searches.
Manages compatibility settings for legacy applications.
Configures the number of permissible file locks.
Controls boot logo display when using PTS-DOS boot manager.
Specifies count, sequence, I/O port address, and timeout parameters for LPT1 device.
Same parameters as LPT1 but applied to LPT2 device.
Same configuration as LPT1 but targeting LPT3 device.
Enables and configures LPT4 printer port device.
Sets delay before increasing process priority level.
Defines memory allocation policies and behavior.
Specifies default DOS memory allocation strategy settings.
Establishes menu option definitions.
Configures menu color schemes (emulated via ECHO commands in DR-DOS).
Sets default menu block (simulated using TIMEOUT and SWITCH commands in DR-DOS).
Defines individual menu blocks (emulated through ECHO and SWITCH commands in DR-DOS).
Enables multitrack disk read/write operations.
Continues CONFIG.SYS processing by loading another file after driver installation, setting %NEWFILE% environment variable.

NTemplate:NbndQ

Defines the default No () character used in Yes/No/Resume prompts.
Controls whether keyboard [[Num Lock|Template:Keypress]] is enabled or disabled by default.
Executes conditionally based on the last return code or error status, e.g., .
Similar to and , displays a message and waits for a key press response.
Determines if user confirmation is required upon errors in CONFIG.SYS processing.
Configures buffer sizes for LPT1 through LPT3 ports.
Enables conditional execution exclusively on PC-compatible machines.
Sets parameters for priority scheduling of processes.
Adjusts disk I/O program priority levels within the scheduler.
Changes default internal printer driver from LPT1 to alternatives such as LPT3 or LPT4.
Specifies whether DOS applications are permitted to execute.
Loads a user interface component or shell environment.
Conditional execution targeting IBM PS/1-compatible hardware only.
Conditional execution targeting IBM PS/2-compatible hardware only.
Suppresses output sent to STDOUT display.

RTemplate:NbndT

Determines whether the system should automatically restart upon encountering errors.
Enables the inclusion of comments within CONFIG.SYS.
Reserves a specific drive letter, preventing its use by local block device drivers.
Sets the default response character for Yes/No/Resume prompts.
Returns control from nested CONFIG.SYS processing back to the prior GOSUB or SWITCH command, optionally passing a return code.
Defines the size of real mode memory available.
Allows programs specified in CONFIG.SYS to load simultaneously in the background, functioning similarly to CALL or INSTALL commands.
Controls whether the first character of deleted files is saved in the FAT reserved area.
Determines video mode under FreeDOS or selects screen access methods for PTS-DOS.
Sets the status of the keyboard Scroll Lock key (on or off).
Establishes environment variables.
Loads the command interpreter shell.
Functions like SHELL but supports a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMBs to minimize fragmentation.
Specifies states for keyboard modifiers such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Indicates whether files should be closed upon pressing Ctrl+Alt+Del.
Defines if POST should be bypassed during reboot.
, STACKSIZE, STACKSHIGH
Configure hardware interrupt stack sizes and buffer locations across various DOS versions and derivatives.
, SYSBOOT, SYSGEN, SYSLOAD
PTS-DOS specific options managing boot manager settings, alternative operating system boot files, memory addresses of DOS components, and loading systems from alternate disk locations.
, STUBA20
Internal or hardware control parameters unique to certain DOS variants.
, SWITCH
Enables conditional processing blocks within DOS configurations (note that SUBMENU is unsupported by DR-DOS and FreeDOS).
, SWAPPATH
OS/2 configurations specifying drives for error logs and paths for swap files.
, SWITCHES
Sets default switch characters ('/' or '-') and defines special options applicable to DOS variants except PTS-DOS.
, THREADS, TIMESLICE
OS/2 settings addressing FPU bug fixes, number of concurrent threads, and scheduler time slice durations.
, TRACE, TRACEBUF
Manage timeouts during CONFIG.SYS processing, enable step-by-step debugging of CONFIG.SYS/AUTOEXEC.BAT scripts, and configure log buffer sizes across DOS variants including DR-DOS, PTS-DOS, FreeDOS, and OS/2.
, TRAPDUMP
Specifies temporary file extensions (PTS-DOS) and comprehensive error logging features (OS/2).

UTemplate:NbndZ

Directs DOS to utilize a designated segment as Upper Memory Block (UMB) memory.
Configures the UMB server component.
Defines address ranges allocated as UMB RAM.
Toggles disk write verification on or off.
Specifies the DOS version reported to applications.
Sets VGA display status parameters.
Determines the current video mode in use.
Enables or disables the use of virtual DMA capabilities.
Controls whether Virtual Mode Extensions of the processor are turned off.
Configures VxD driver settings for Windows environments.
Sets system support parameters for Windows operations.
Manages relocation settings for the Extended BIOS Data Area (EBDA).
Enables conditional execution tailored for XT-compatible machines.
Configures integrated Year 2000 compliance support.
Defines the default character used for affirmative responses in prompts.
Manages tracking of file deletions.

Challenges

Although the system can initiate without CONFIG.SYS or AUTOEXEC.BAT, these files are crucial for comprehensive DOS customization and meeting software prerequisites. Any damage to these files requires diagnostic efforts.

In the absence or corruption of a SHELL entry in CONFIG.SYS, 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 missing. From MS-DOS 6.0/PC DOS 6.1 onward, as well as Novell DOS 7 and later, users are prompted to specify the command interpreter's location. This prompt also appears if the primary command processor terminates unexpectedly or intentionally, allowing a limited shell replacement without needing a system restart.

COMMAND.COM from MS-DOS 7.0 and later is not compatible with DR-DOS. In environments where dual-booting is configured, DR-DOS versions 7.02 and above prevent skipping SHELL directives during skip, trace, or step operations to improve system reliability. Some iterations introduced recovery mechanisms for invalid SHELL parameters by reactivating skip mode and requesting a valid shell path before loading COMMAND.COM.

CONFIG.SYS file size restrictions differ: MS-DOS and PC DOS impose limits ranging from a few kilobytes up to 64 KB in newer releases, whereas DR-DOS permits virtually unlimited size constrained only by the underlying file system. MS-DOS processes CONFIG.SYS by compiling it into a tokenized structure in memory, prioritizing device driver loading before TSRs. Conversely, DR-DOS parses directives sequentially, giving users fine-grained control over load order through DEVICE and INSTALL commands—useful for troubleshooting driver conflicts or incorporating temporary utilities during boot.

In MS-DOS and PC DOS versions between 2.0 and 4.01, the SHELL line was limited to 31 characters; subsequent releases extended this limit to 128 characters. DR-DOS supports up to 255 characters for this directive. It should be noted that CONFIG.SYS directives do not accommodate long filenames.

Dual Booting DOS with Windows 9x

When Windows 95 is installed over an existing DOS/Windows environment, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed to CONFIG.DOS and AUTOEXEC.DOS respectively, enabling dual-boot functionality between Windows 9x and DOS modes. During a DOS boot session, these renamed files are temporarily restored to their standard names. Meanwhile, Windows 95 maintains backup copies labeled CONFIG.W40 and AUTOEXEC.W40.

For systems running Caldera DR-DOS versions 7.02 or 7.03 alongside Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT remain untouched. Instead, DR-DOS employs its own startup scripts named DCONFIG.SYS and AUTODOS7.BAT.

OS/2 and Windows NT

OS/2 depends extensively on CONFIG.SYS for setting up device drivers and environment parameters prior to launching its graphical user interface.

Within the OS/2 subsystem of Windows NT, configuration values equivalent to CONFIG.SYS are stored within the system registry rather than in traditional configuration files.

A variety of undocumented CONFIG.SYS directives exist specifically for OS/2 systems.

CONFIG.SYS continues to play a vital role in OS/2 successors such as eComStation and ArcaOS.

See also

External links

  • Information on AUTOEXEC.BAT and CONFIG.SYS – Computer Hope (2017)
  • Overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS commands – Microsoft Support (archived)
  • CONFIG.SYS command guide – Caldera (1998) (partial DR-DOS 7 directives)
  • FreeDOS CONFIG.SYS command descriptions – FreeDOS Help
  • PTS-DOS 2000 Pro User Guide with CONFIG.SYS commands (partial) – Paragon Software
  • Unofficial German PTS-DOS FAQ (PTS/FAQD) featuring extra CONFIG.SYS commands (2004)