Jump to content

DRSWITCH (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article DRSWITCH (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983
ProductsConfiguration for DOS and OS/2 operating systems

CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, holds setup instructions that the operating system's DOS BIOS—typically found in IBMBIO.COM or IO.SYS—interprets during system startup. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

CONFIG.SYS directives are responsible for configuring DOS to manage devices, applications, and memory allocation. Once CONFIG.SYS has been processed, DOS launches the command interpreter specified by the SHELL directive; if none is defined, it defaults to COMMAND.COM, which then executes AUTOEXEC.BAT.

The file predominantly contains name=value pairs that adjust system parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs) into memory. CONFIG.SYS is located in the boot drive’s root directory.

The same filename is also utilized by (DCP), an MS-DOS variant developed by East-German company VEB Robotron.

Certain DOS derivatives prioritize alternative configuration filenames over CONFIG.SYS:

- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 employ CCONFIG.SYS or CCONFIG.INI instead, with supplementary settings stored in CCONFIG.BIN, which can be altered using CONFIG.EXE. - Versions of DR DOS starting from 3.31 (including PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02+) prioritize DCONFIG.SYS to support multi-boot configurations and disk compression features. Additionally, OpenDOS and DR-DOS recognize ODCONFIG.SYS or DRCONFIG.SYS. - DR-DOS 6.0 and later allow modification of default system file extensions through SYS /DR:ext, enabling multiple sets of system files within a single root directory selectable via boot loaders like LOADER. The SHELL command also supports specifying alternative AUTOEXEC.BAT filenames and extensions, a capability shared with 4DOS. - The CHAIN=filespec directive available in DR-DOS facilitates continuation of configuration from other files, optionally targeting specific labels within those files.

Other variants use different names: FreeDOS uses FDCONFIG.SYS; RxDOS version 7.24 and above utilize RXCONFIG.SYS; and PTS-DOS employs CONFIG.PTS.

In Windows 95 and 98—both based on DOS—CONFIG.SYS and AUTOEXEC.BAT are present in the root directory of the boot drive but generally remain empty. Windows Me no longer processes CONFIG.SYS during startup; instead, it retrieves environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

Within the FlexOS operating system, CONFIG.SYS is implemented as a binary file that specifies resource managers and device drivers to be loaded at boot time.

Example

Below is a sample CONFIG.SYS file configured 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>

:;*?!

Creates labels within CONFIG.SYS that serve as jump points for , , , , and commands.
Functions similarly to , also used for inline comments following other directives. In MS-DOS/PC DOS, inline comments are not ignored if enclosed within double quotes.
Introduces inline comments alongside the ; directive.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. Starting with DOS 6.0, a similar confirmation can be requested by appending after a directive (e.g., ).
Forces immediate execution of the next CONFIG.SYS directive without any prompts.

ATemplate:NbndC

Determines whether programs can be terminated upon encountering errors.
Configures which drives retain file access timestamps within FAT file systems.
Enables conditional execution exclusively on AT-compatible hardware.
Manages boot selection.
Adjusts the detail level of error message output.
Changes the default serial port driver for the AUX device from COM1: to COM4:.
Prevents character devices from being accessible outside the virtual \DEV directory.
Loads a fundamental device driver into system memory.
Produces a brief beep sound even if audible alerts are disabled.
Specifies the operating system designated for the next boot cycle.
Enables or disables enhanced Ctrl+C detection.
Defines the quantity of disk buffers allocated.
Similar to BUFFERS but allocates buffers within HMA or UMB memory areas.
Sets the maximum count of cache blocks allocated from the system pool.
Establishes the maximum duration before idle cache blocks are returned to the system pool.
Defines the maximum interval before modified cache blocks are written back to disk.
Executes programs listed in CONFIG.SYS, pausing further processing until completion.
Sets the Caps Lock key status at startup (enabled or disabled).
Specifies the driver name for CD-ROM hardware.
Determines the number of buffers assigned for CD-ROM operations.
Continues CONFIG.SYS processing within a new file or under a specific label.
Specifies the type of system clock in use.
Clears the display screen.
Defines OEM codepage(s) for character encoding.
Indicates CMOS RAM address parameters.
{ { nobold | (PTS - DOS only) } }
Defines color settings for the boot menu interface.
{ { mono | 1 = COM1 } } { { nobold | (DR - DOS 7.02 + ) } }
Sets I/O address, timeout, count, and logical sequence for COM1 device.

Equivalent directives exist for COM2, COM3, and COM4 with matching configurations.

{ { mono | 1 = COMAREA } } { { nobold | (PTS - DOS only) } }
Specifies DMA buffer parameters.
{ { mono | 1 = COMMENT } } { { nobold | (DOS 4.0+, RxDOS) } }

Redefines inline comment prefix characters or causes subsequent line to be ignored.
Not processed under DR-DOS 7.02+, Embedded DOS, and PTS-DOS.

{ { mono | 1 = COUNTRY } } { { nobold | (DOS 3.0+, DOS Plus 2.1 with FIDDLOAD, DR DOS 3.31+, OS/2, PTS-DOS) } }
Activates and configures internationalization support.
{ { mono | 1 = CPOS } } { { nobold | (DR DOS 6.0+) } }
Specifies cursor position on screen for configuration menu displays.

Additional CPU-related directives manage conditional execution based on processor types (8088, 8086, 286, 386, etc.), primarily relevant within PTS-DOS and DR-DOS systems.

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Defines memory segment address used for multi-sector disk data deblocking operations.
Activates internal debugger functionality.
Manages boot selection processes.
Loads specified device drivers into memory.
Loads device drivers into upper memory blocks (equivalent to in DRDOS 5.0).
Configures country and codepage settings for keyboard, screen, and printer devices.
Sets cache memory size parameters.
Selects floppy disk compatibility mode settings.
Specifies font used for display output.
Controls loading of DOS into high memory and utilization of upper memory blocks.
Loads DOS tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory areas.
Indicates an alternative directory path for DOS system files.
Defines search paths for data files.
Specifies physical parameters of disk drives.
Establishes configuration parameters for unrecognized drives.
See .
Enables error logging to PDUMP.nnn files and specifies target drive.
Displays textual messages on-screen during startup or configuration processing.
Outputs messages including ANSI escape sequences for enhanced formatting.
Specifies additional checks before program startup execution.
Sets expected error or return codes for program termination handling.
Defines A20 gate state during program startup routines.
Terminates CONFIG.SYS processing prematurely (exceptions apply to SWITCHES and SHELL under certain conditions).
Configures hash table size to optimize file open operations (distinct from MS-DOS FASTOPEN).
Sets number of cached File Control Blocks allowed open simultaneously (shares buffer with FILES under DR-DOS).
Similar to FCBS but explicitly loads FCBs into upper memory segments.
Manages boot selection processes again.
Determines maximum number of simultaneously open files allowed by the system.
Similar to FILES but explicitly loads file handles into upper memory segments.
Facilitates inclusion and execution of designated CONFIG.SYS subsections (refer to IGNORE).

GTemplate:NbndI

Waits for a keystroke or timeout, setting the error level to the ASCII value of the key pressed 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 information.
Consult for further details.
See for more context.
Refer to or for related commands.
See or for additional options.
Refer to for further explanation.
Loads a TSR program following relocation of the DOS data segment, functioning similarly to .
See , , or for more details.
Consult for related instructions.
See , or to enable console and command line history buffer along with extended pattern searching.
Defines the address of the HMA segment.
Configures energy-saving behavior related to the HLT instruction.
Activates scanning of boot sector viruses.
Loads file systems that can be installed dynamically.
Omits execution of specified subsections within CONFIG.SYS.
Permits designated programs to execute at ring 2, granting direct hardware I/O access.
Incorporates directives from another menu block (emulated through GOSUB/RETURN in DR-DOS).
Sets the status of the keyboard Insert mode.
Installs TSR programs into conventional memory.
Loads TSR programs into upper memory areas (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSRs after relocating the DOS data segment.
Adjusts PIC interrupt priorities, elevating a specified IRQ number to highest precedence.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the address for the relocated keyboard buffer.
Sets the upper limit for accessible drive letters.
Similar to LASTDRIVE but loads Current Directory Structure (CDS) into upper memory regions.
Lists directories searched for dynamic link libraries (DLLs).
Manages backward compatibility with legacy applications.
Determines the quantity of file locks allowed.
Configures whether the boot logo is displayed during startup sequences.
Sets parameters such as count, order, I/O address, and timeout for the LPT1 device.
Applies identical settings as LPT1 for the LPT2 device.
Mirrors LPT1 configuration settings for LPT3 device usage.
Enables and configures LPT4 device similarly to previous LPT devices.
Defines delay duration before increasing process priority levels.
Controls how memory allocation is handled by DOS.
Specifies default strategies for DOS memory allocation behavior.
Establishes menu option configurations.
Sets color schemes for menus (can be emulated under DR-DOS).
Identifies default menu block (emulatable in DR-DOS environments).
Specifies individual menu blocks (DR-DOS emulation supported).
Enables operations involving multitrack disk drives.
Continues processing CONFIG.SYS from a new file after loading a device driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Defines the default No () response character in Yes/No/Resume prompts.
Sets keyboard Num Lock state as enabled or disabled at startup.
Allows conditional execution based on the last error code, e.g., .
Displays a message and waits for a key press, similar in function to and in DR-DOS systems.
Requires user confirmation upon encountering errors during CONFIG.SYS processing.
Configures buffer sizes allocated to LPT ports.
Enables conditional execution specifically on PC-compatible hardware platforms.
Adjusts scheduler priority levels within DOS operations.
Sets priority parameters governing disk input/output processes.
Changes default printer device driver assignment (from LPT1 to LPT3 or LPT4).
Controls whether DOS applications are permitted to execute.
Loads a user interface shell environment during startup.
Enables conditional execution on IBM PS/1-compatible machines only.
Allows conditional execution restricted to IBM PS/2-compatible systems.
Suppresses output sent to standard output (STDOUT).

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS.
Allocates drive letters for local block device drivers.
Defines the default Resume (R) character used in Yes/No/Resume prompts.
Returns control from nested CONFIG.SYS processing back to the previous GOSUB or SWITCH statement, optionally providing a return code.
Sets the size of real mode memory.
Loads multiple programs concurrently in CONFIG.SYS, functioning similarly to CALL or INSTALL commands under DOS.
Saves the initial character of deleted files in the FAT reserved area.
Determines video mode settings (FreeDOS) or screen access methods (PTS-DOS).
Configures the keyboard Scroll Lock state to on or off.
Establishes environment variables.
Loads the command interpreter shell.
Similar to SHELL but includes a size parameter allowing pre-allocation of COMMAND.COM in HMA or UMBs, enhancing memory efficiency with third-party shells.
Sets keyboard modifier keys such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Specifies whether files close upon pressing Ctrl+Alt+Del.
Skips the Power-On Self Test (POST) during reboot sequences.
, STACKSIZE, STACKSHIGH
Manage hardware interrupt stack sizes and buffer locations across various DOS versions and embedded systems, improving system stability and memory utilization.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
PTS-DOS-specific commands that control boot options, system loading areas, and memory allocation for performance optimization.
, SUPPRESSPOPUPS, SWAPPATH
Operating system directives that regulate menu block behavior, error log file locations, and swap file paths to enhance system administration efficiency.
, SWITCHES, SWITCHAR
Govern conditional processing flow within CONFIG.SYS and define system switch characters across different DOS variants for adaptable configuration management.
, THREADS, TIMESLICE
OS/2 parameters addressing hardware workaround implementation, concurrency control, and scheduler timing to optimize multitasking performance.
, TRACE, TRACEBUF
Oversee CONFIG.SYS execution timeouts, enable step-by-step debugging modes, and configure trace log buffers to assist diagnostics under DR-DOS, PTS-DOS, and OS/2 platforms.
, TRAPDUMP
Designates temporary file extensions (PTS-DOS) and detailed error logging options (OS/2) to support system maintenance and troubleshooting efforts.

UTemplate:NbndZ

Assigns a particular segment for use as Upper Memory Block (UMB).
Configures the UMB management server.
Defines address ranges designated as UMB RAM.
Enables or disables verification of disk writes.
Sets the DOS version reported to applications.
Manages VGA display status settings.
Specifies the current video mode in use.
Determines whether virtual DMA is permitted.
Controls deactivation of processor Virtual Mode Extensions (VME).
Configures VxD drivers for Windows environments.
Sets up system support parameters for Windows operation.
Handles relocation of the Extended BIOS Data Area (XBDA).
Facilitates conditional execution on XT-compatible machines.
Enables built-in Year 2000 compliance features.
Establishes the default affirmative response character in prompts.
Configures tracking of file deletions.

Issues

Although the system can initiate booting without a CONFIG.SYS file or if it is damaged, this file together with AUTOEXEC.BAT is critical for comprehensive DOS startup and customization tailored to software requirements. Corruption or loss of these files requires diagnostic intervention.

If CONFIG.SYS lacks a SHELL directive or is missing/corrupt, DOS attempts to locate COMMAND.COM within the root directory of the boot drive. Versions prior to DOS 6.0 will fail to boot if COMMAND.COM is absent. In contrast, MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later prompt users for a command interpreter path and offer limited runtime shell replacement without rebooting.

Because MS-DOS 7.0+ COMMAND.COM is incompatible with DR-DOS systems, DR-DOS versions 7.02 and above enforce SHELL directives during skip/trace modes to prevent boot failures. If no valid shell is detected, users receive a prompt before COMMAND.COM is loaded from the root directory.

CONFIG.SYS file size restrictions differ by operating system: MS-DOS/PC DOS allows up to 64 KB in recent releases, whereas DR-DOS imposes no explicit size limit beyond filesystem constraints. This reflects divergent processing methods—MS-DOS compiles CONFIG.SYS into a tokenized memory block before sorting directives (loading device drivers ahead of TSRs), while DR-DOS interprets each directive sequentially at runtime. This approach grants full control over driver and TSR loading order using DEVICE and INSTALL, enabling resolution of load conflicts and integration of temporary external utilities during boot.

In MS-DOS/PC DOS versions from 2.0 through 4.01, the SHELL command line was restricted to 31 characters. Later versions expanded this limit up to 128 characters, while DR-DOS permits up to 255 characters. Notably, CONFIG.SYS directives do not support long filename syntax.

Dual Booting with 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 change enables dual boot functionality between Windows 9x and DOS. During a DOS boot, these files are temporarily reverted to their original filenames. Meanwhile, the Windows 95 versions are preserved under the names CONFIG.W40 and AUTOEXEC.W40.

In configurations where Caldera DR-DOS 7.02 or 7.03 coexist with Windows 95, the original CONFIG.SYS and AUTOEXEC.BAT files used by Windows remain untouched. Instead, DR-DOS employs DCONFIG.SYS and AUTODOS7.BAT as its startup configuration files.

OS/2 and Windows NT

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

Within the OS/2 subsystem integrated into Windows NT, the CONFIG.SYS file perceived by OS/2 applications is actually stored within the Windows registry.

There are numerous undocumented CONFIG.SYS commands specific to OS/2.

CONFIG.SYS continues to be utilized by OS/2-based operating systems such as eComStation and ArcaOS.

See also

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 directives description (archived)
  • PTS-DOS 2000 Pro User Manual including CONFIG.SYS directives (archived)
  • Inoffizielle deutschsprachige PTS-DOS-FAQ (archived) – comprehensive guide to CONFIG.SYS directives