SWITCH (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Computer software |
| Founded | 1983 |
| Products | System configuration 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, contains setup instructions interpreted by the system's DOS BIOS—commonly found in IBMBIO.COM or IO.SYS—during the boot sequence. The CONFIG.SYS file was first introduced with DOS version 2.0.
Usage
The directives within CONFIG.SYS are responsible for configuring DOS to manage devices, applications, and memory allocation. Once CONFIG.SYS has been processed, DOS initiates the command interpreter designated by the SHELL command; if none is specified, it defaults to COMMAND.COM, which then executes the commands in the AUTOEXEC.BAT file.
This configuration file primarily contains name=value pairs that set adjustable parameters or load device drivers and terminate-and-stay-resident programs (TSRs) into memory. CONFIG.SYS is typically located in the root directory of the bootable drive.
Certain DOS variants check for alternative configuration filenames that override CONFIG.SYS:
Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI (in Multiuser DOS) and MCONFIG.SYS (in REAL/32). These operating systems support enhanced configuration options stored in binary files such as CCONFIG.BIN, which are generally managed through CONFIG.EXE.
Starting with DR DOS 3.31 and continuing through PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02+, a file named DCONFIG.SYS takes precedence over CONFIG.SYS. This feature supports multi-boot environments and disk compression setups where drive letters may change after loading compression drivers.
OpenDOS 7.01 and DR-OpenDOS 7.02 also recognize ODCONFIG.SYS, while some versions of DR-DOS 7.02+ look for DRCONFIG.SYS. From DR DOS 6.0 onward, the SYS /DR:ext command permits customization of default system file extensions, enabling multiple sets of system files to coexist within a single root directory—these can be selected via boot loaders such as LOADER included with Multiuser DOS and DR-DOS.
The SHELL directive allows specifying alternative AUTOEXEC.BAT files using /P[:filename.ext], with COMMAND.COM accepting file extensions other than ".BAT" in this mode—a capability also supported by 4DOS.
From version 6.0 forward, DR-DOS includes a CHAIN=filespec directive that enables continuation of processing another configuration file, optionally targeting a specific section using a label parameter (CHAIN=filespec,label). Additionally, DR-DOS 7.03+ introduced the SYS /A option to copy both CONFIG.SYS and AUTOEXEC.BAT alongside system files.
FreeDOS employs a similar configuration file named FDCONFIG.SYS; RxDOS versions 7.24 and above use RXCONFIG.SYS; while PTS-DOS relies on CONFIG.PTS.
Although based on DOS, Windows 95 and Windows 98 include CONFIG.SYS and AUTOEXEC.BAT on their boot drives but generally keep these files empty. In contrast, Windows Me does not process CONFIG.SYS during startup; instead, environment variables are loaded from the Windows Registry at:
- HKLM\System\CurrentControlSet\Control\SessionManager\Environment
Within the FlexOS operating system, CONFIG.SYS differs as a binary file that outlines resource managers and device drivers to be loaded during system initialization.
Example
An example 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>
:;*?!
- Used to define labels within CONFIG.SYS that serve as jump points for , , , , and commands.
- Functions similarly to , also utilized for inline remarks following other CONFIG.SYS entries. (Note: MS-DOS/PC DOS does not disregard inline comments enclosed in double quotes.)
- Initiates inline comments alongside the ; directive.
- Prompts Yes/No confirmations with optional messages before executing subsequent CONFIG.SYS instructions. (FreeDOS supports conditional execution with boot menus but lacks optional message support.) DOS versions 6.0 and later implement a comparable feature by appending after the directive, which DR DOS also accommodates.
- Forces immediate execution of the next CONFIG.SYS command without conditions.
ATemplate:NbndC
- Determines whether programs can be interrupted upon encountering errors.
- Sets which drives record file access timestamps within reserved FAT directory entries.
- Enables conditional execution on AT-compatible hardware.
- Provides boot management functionality.
- Adjusts the level of detail displayed in error messages.
- Alters the default serial port driver assignment (COM1: through COM4:) for the AUX device.
- Prevents access to character devices outside the virtual \DEV directory.
- Loads a fundamental device driver into memory.
- Produces a brief beep even if sound notifications are disabled.
- Specifies the operating system to boot subsequently.
- Enables or disables enhanced Ctrl+C detection.
- Defines the quantity of disk buffers allocated.
- Similar to BUFFERS but loads buffers into HMA or UMB memory areas.
- Sets the maximum number of dynamically allocated 512-byte cache blocks.
- Defines the maximum idle time before unused cache blocks return to the system pool.
- Establishes the maximum delay before dirty cache blocks are written to disk.
- Loads programs during CONFIG.SYS processing, running them in the foreground and pausing further processing until completion.
- Indicates whether Caps Lock is enabled or disabled on the keyboard.
- Names the CD-ROM hardware driver used.
- Specifies the number of buffers allocated for CD-ROM access.
- Continues processing CONFIG.SYS commands from another file, optionally starting at a specified label (available since DR-DOS 7.02).
- Defines the type of system clock employed.
- Clears the screen display.
- Sets one or more OEM codepages.
- { { nobold | (PTS - DOS only) } }
- Assigns CMOS RAM address locations.
- { { mono | 1 = COLOR } } { { nobold | (PTS - DOS only) } }
- Configures colors used in boot menus.
- { { mono | 1 = COM1 } } { { nobold | (DR - DOS 7.02 + ) } }
- Specifies count, sequence, I/O address, and timeout parameters for COM1 devices.
Equivalent settings apply for COM2, COM3, and COM4 under DR-DOS 7.02 and later versions.
- { { mono | 1 = COMAREA } } { { nobold | (PTS - DOS only) } }
- Designates DMA buffer areas.
- { { mono | 1 = COMMENT } } { { nobold | (DOS 4.0+, RxDOS, ignored under DR-DOS 7.02+, Embedded DOS, PTS - DOS) } }
- Alters leading characters for inline comments or causes lines to be ignored entirely.
- { { 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 features.
- { { mono | 1 = CPOS } } { { nobold | (DR-DOS 6.0+ ) } }
- Sets cursor position for configuration menus on screen display.
- { { mono | 1 = CPSW } } { { nobold | (MS-DOS 4.00 - 4.01 only, ignored in DR-DOS 7.02+ )} }
- Supports codepage switching capabilities.
CPU-specific directives
Conditional execution commands designate particular CPU models:
- CPU88, CPU88+ — targeting Intel 8088 and subsequent processors
- CPU86, CPU86+ — applicable to Intel 8086/8088 and newer CPUs
- CPU286, CPU286+ — for Intel 286 and above
- CPU386, CPU386+ — compatible with Intel 386 and later (available from DR-DOS 7.02 onward)
- CPU486, CPU486+ — intended for Intel 486 and higher
These directives enable CONFIG.SYS to adapt processing according to the processor's features, thereby enhancing system setup efficiency.
DTemplate:NbndF
- Manages relocation of drive descriptor tables.
- Defines memory segment limits for multi-sector disk data deblocking.
- Activates internal debugger functionality.
- Functions as a boot manager.
- Loads device drivers into conventional memory.
- Loads device drivers into upper memory (equivalent to in DRDOS 5.0).
- Sets country and codepage configurations for keyboard, screen, and printer devices.
- Adjusts cache memory allocation sizes.
- Configures floppy disk compatibility modes.
- Specifies the display font to be used.
- Controls loading DOS into high memory and utilization of upper memory areas.
- Moves DOS tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory space.
- Provides an alternative directory path for DOS files.
- Establishes search paths for data files.
- Defines physical attributes of disk drives.
- Sets parameters for drives not recognized by the system.
- Refer to .
- Enables drive support for PDUMP.nnn error logging files.
- Outputs a message on the screen.
- Displays a message incorporating ANSI escape codes.
- Enables additional validation checks when launching programs.
- Sets an expected error or return code value.
- Determines A20 gate state during program startup.
- Terminates CONFIG.SYS processing before reaching file end (except for SWITCHES and SHELL commands).
- Configures hash table size to accelerate file open operations (differs from MS-DOS FASTOPEN driver).
- Specifies the number of cached File Control Blocks (FCBs) allowed simultaneously (shares buffer with FILES in DR-DOS).
- {{
- Explicitly loads FCBs into upper memory.
- Functions as a boot manager.
- Defines maximum number of simultaneously open files.
- Explicitly loads file handles into upper memory.
- Includes execution of designated CONFIG.SYS subsections (see IGNORE).
GTemplate:NbndI
- Waits for a key press or timeout, setting error level to the key’s ASCII code or 1024 if timed out.
- Resumes CONFIG.SYS processing at a specified label.
- Continues nested CONFIG.SYS processing at a given label, then returns to the previous location.
- See , , or .
- See .
- See .
- See or .
- See or .
- See .
- Loads a TSR program into memory similarly to , but after relocating the DOS data segment.
- See , , or .
- See .
- See or .
- Enables console and command line history buffers along with extended pattern searching capabilities.
- Specifies the address of the High Memory Area (HMA) segment.
- Configures energy-saving mode using the HLT instruction.
- Specifies system scanning for boot sector viruses.
- Loads installable file system drivers.
- Prevents execution of specified CONFIG.SYS subsections.
- Allows certain applications to operate at ring 2 privilege level for direct hardware I/O access.
- Incorporates directives from another menu block (emulated through GOSUB/RETURN in DR-DOS).
- Sets keyboard Insert mode status on or off.
- Installs TSR programs into conventional memory.
- Loads TSR programs into upper memory (equivalent to HIINSTALL in DR DOS 5.0).
- Installs TSR programs post DOS data segment relocation.
- Adjusts PIC interrupt priorities by rotating to prioritize a specific IRQ number.
KTemplate:NbndM
- Designates the keyboard layout configuration.
- Indicates the address for the relocated keyboard buffer.
- Determines the highest number of accessible drives.
- Functions like LASTDRIVE but loads the Current Directory Structure into upper memory.
- Specifies paths for DLL searching.
- Manages legacy application loading procedures.
- Sets the quantity of file locks permitted.
- Configures the boot screen logo and initial startup messages.
- Defines the count, sequence, I/O port, and timeout settings for the LPT1 device.
- Mirrors LPT1 configuration parameters for LPT2 device.
- Applies LPT1 settings to LPT3 device.
- Activates and sets parameters for the LPT4 device.
- Establishes wait duration before elevating process priority in waiting queues.
- Configures strategies for memory allocation.
- Specifies the default DOS memory allocation approach.
- Defines menu option entries.
- Assigns menu color schemes (simulated by ECHO commands under DR-DOS).
- Sets default menu block behavior (emulated via TIMEOUT and SWITCH in DR-DOS).
- Creates a menu block definition (emulated through ECHO and SWITCH commands in DR-DOS).
- Enables multitrack disk operation support.
- Continues processing CONFIG.SYS from an additional file, optionally after loading a designated driver and setting the %NEWFILE% environment variable.
NTemplate:NbndQ
- Specifies the default 'No' character used in Yes/No/Resume prompts.
- Sets the status of keyboard [[Num Lock|Template:Keypress]] key.
- Allows conditional execution based on the last error code, e.g., .
- Displays a message and waits for a key press, similar to DR-DOS commands and .
- Requires user confirmation upon encountering errors in CONFIG.SYS.
- Configures buffer size for LPT ports.
- Enables conditional execution specifically on PC-compatible hardware.
- Sets scheduler priority level for processes.
- Determines disk I/O priority assigned to applications.
- Changes the default printer device driver among LPT1–LPT4 ports.
- Controls execution permissions for DOS applications.
- Loads a user interface shell environment.
- Enables conditional execution on IBM PS/1-compatible systems.
- Enables conditional execution on IBM PS/2-compatible systems.
- Suppresses output display on STDOUT.
RTemplate:NbndT
- Activates automatic system reboot following critical errors.
- Permits inclusion of comments within CONFIG.SYS files.
- Reserves a drive letter for local block device drivers.
- Defines the default 'Resume' character used in prompts.
- Returns processing flow within nested CONFIG.SYS files to previous GOSUB or SWITCH locations, optionally with a return code.
- Specifies size of real mode memory allocation.
- Allows concurrent loading of programs in the background during CONFIG.SYS processing, akin to CALL or INSTALL commands on other systems.
- Determines storage location of deleted file's first character within FAT reserved area.
- Under FreeDOS, sets video mode parameters; under PTS-DOS, controls screen access methods.
- Sets keyboard Scroll Lock key status.
- Defines environment variables for system use.
- Loads command interpreter shell interface.
- Similar to SHELL directive but supports SIZE parameter to pre-allocate COMMAND.COM into High Memory Area or Upper Memory Blocks, optimizing memory utilization with third-party shells.
- Configures keyboard modifier key states including Shift Lock, Num Lock, and Scroll Lock.
- Specifies behavior of file closure upon Ctrl+Alt+Del key sequence.
- Skips Power-On Self-Test during reboot cycles.
- , STACKSIZE, STACKSHIGH
- Configure stack size parameters across multiple DOS versions and embedded systems to enhance interrupt handling and optimize memory usage.
- (PTS-DOS)
- Manages boot manager settings for system startup control.
- Defines submenu blocks within CONFIG.SYS (emulatable under DR-DOS).
- {{
- Directs error logging output to specified drive instead of popup dialogs.
- , SWITCHAR, SWITCHES
- Establish swap file locations, designate system switch characters ('/' or '-'), and configure special options for various DOS versions.
- , SYSGEN, SYSLOAD (PTS-DOS)
- Manage alternative operating system boot files, DOS memory placement, and system loading areas to provide flexible startup configurations.
- , THREADS (Embedded DOS, OS/2)
- Define system memory pools alongside concurrent thread limits to optimize resource distribution efficiently.
- , TRACE (DR-DOS, PTS-DOS, OS/2)
- Control command timeouts within CONFIG.SYS and enable single-step debugging with logging capabilities via TRACEBUF (OS/2).
- , TRAPDUMP (PTS-DOS, OS/2)
- Specify temporary file extensions and detailed error logging setups.
This segment details essential CONFIG.SYS directives spanning various DOS implementations that are crucial for configuring system parameters, managing memory resources, controlling devices, and enhancing boot performance—key considerations for enterprises utilizing legacy or embedded DOS platforms.
UTemplate:NbndZ
- Assigns a designated segment for use as an Upper Memory Block (UMB) in DOS.
- Defines the server responsible for managing UMBs.
- Specifies memory address ranges allocated to UMB RAM.
- Toggles disk write verification on or off.
- Determines the DOS version presented to applications.
- Sets VGA display status parameters.
- Indicates the active video mode.
- Activates virtual DMA functionality.
- Regulates the processor’s Virtual Mode Extensions.
- Configures the VxD driver utilized by Windows.
- Sets up Windows system support features.
- Oversees relocation of the Extended BIOS Data Area.
- Enables conditional execution on XT-compatible hardware.
- Manages built-in Year 2000 compliance settings.
- Defines the default affirmative response character in prompts.
- Monitors file deletion activities.
Issues
Although the system is capable of booting without CONFIG.SYS or AUTOEXEC.BAT, these files are crucial for tailoring the operating system and loading necessary software components. Any corruption or damage to either file requires diagnostic intervention.
In cases where CONFIG.SYS lacks a SHELL directive, or if it is missing or corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Earlier versions prior to 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 and above, users are prompted to specify an alternative command interpreter path if COMMAND.COM is absent or fails to launch. This prompt facilitates a limited runtime shell substitution without needing a reboot.
COMMAND.COM from MS-DOS version 7.0 and later is incompatible with DR-DOS, which commonly resides in drive C:’s root within dual-boot environments. Beginning with DR-DOS 7.02, enforcement of SHELL directives occurs during skip, trace, or step modes, blocking bypasses that were possible in earlier releases. Subsequent updates introduced recovery mechanisms for invalid SHELL parameters by prompting users to enter a valid shell filename before loading COMMAND.COM.
The maximum size allowed for CONFIG.SYS differs between operating systems: MS-DOS and PC DOS impose limits measured in kilobytes (up to approximately 64 KB in newer versions), whereas DR-DOS does not enforce a practical size restriction beyond file system limitations. MS-DOS processes CONFIG.SYS by compiling it into a tokenized format and executes directives in a predetermined sequence—loading device drivers before TSRs. Conversely, DR-DOS parses CONFIG.SYS sequentially line-by-line, enabling precise management over the loading order of drivers and TSRs via DEVICE and INSTALL commands. This approach aids in resolving conflicts during loading and supports conditional execution based on hardware configurations or user input, which is beneficial for troubleshooting and customization.
The INSTALL command in DR-DOS also allows integration of non-resident programs within the CONFIG.SYS processing flow, further enhancing system flexibility.
Earlier MS-DOS versions restricted the length of the SHELL command line to 31 characters; later iterations increased this limit to up to 128 characters, while DR-DOS permits up to 255 characters. CONFIG.SYS directives do not accommodate long filenames.
Dual booting DOS and Windows 9x
When Windows 95 is installed over an existing DOS/Windows configuration, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed CONFIG.DOS and AUTOEXEC.DOS respectively, enabling dual boot functionality between Windows 9x and DOS environments. During a DOS boot session, these files are temporarily restored under their original filenames. Additionally, Windows 95 installation files are backed up as CONFIG.W40 and AUTOEXEC.W40.
In contrast, when Caldera DR-DOS versions 7.02 or 7.03 are installed alongside Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT filenames remain unchanged. Instead, DR-DOS utilizes DCONFIG.SYS and AUTODOS7.BAT for its startup configuration files.
OS/2 / Windows NT
In OS/2, CONFIG.SYS plays a crucial role in setting up drivers and environment variables prior to launching the graphical user interface. Within the OS/2 environment on Windows NT, these CONFIG.SYS configurations are maintained within the system registry instead of a traditional file. OS/2 includes a variety of CONFIG.SYS commands that are not officially documented.
CONFIG.SYS continues to be a fundamental component for system setup 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
- 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) – partial list of DR-DOS 7 directives
- Guide to FreeDOS CONFIG.SYS commands
- User manual for PTS-DOS 2000 Pro including CONFIG.SYS directives (partial)
- German unofficial PTS-DOS FAQ (PTS/FAQD) with additional CONFIG.SYS commands