Jump to content

SWITCHAR (CONFIG.SYS directive)

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

CONFIG.SYS serves as the chief configuration file for the DOS and OS/2 operating system families. This file is a plain ASCII text document containing configuration commands that the operating system's DOS BIOS interprets during the startup sequence. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

CONFIG.SYS directives are used to set up DOS for hardware devices, software applications, and memory handling. Once CONFIG.SYS is processed, DOS launches the command interpreter specified by the SHELL directive; if none is defined, it defaults to COMMAND.COM, which subsequently runs AUTOEXEC.BAT.

Typically, CONFIG.SYS consists of name=value pairs that establish system parameters or load device drivers and TSR (terminate-and-stay-resident) programs. This file is located in the root directory of the bootable drive.

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

Certain DOS versions check for alternative configuration filenames with higher priority than CONFIG.SYS:

- Advanced iterations of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 prefer CCONFIG.SYS or CCONFIG.INI. These systems maintain extra settings in a binary file called CCONFIG.BIN, which is typically edited through CONFIG.EXE.

- In DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, and DR-DOS releases from 7.02 onward, DCONFIG.SYS takes precedence. This facilitates multi-boot environments and supports disk compression utilities that cause drive letter reassignment. Versions like OpenDOS 7.01 and DR-OpenDOS 7.02 also recognize ODCONFIG.SYS, while some DR-DOS editions look for DRCONFIG.SYS.

- Starting with DR-DOS 6.0, users can alter default system file extensions using SYS /DR:ext, enabling multiple parallel sets of system files selectable through boot loaders such as LOADER provided with Multiuser DOS and DR-DOS.

- Enhanced functionality in SHELL directives permits specifying alternative AUTOEXEC.BAT filenames and extensions, a feature also supported by the 4DOS shell.

- The CHAIN=filespec command in DR-DOS allows continuation of configuration processing in additional files, optionally targeting specific labels within those files (CHAIN=filespec,label).

- From DR-DOS version 7.03 onward, the SYS /A command enables copying CONFIG.SYS and AUTOEXEC.BAT alongside other system files.

In other systems, similar roles are played by different filenames: FDCONFIG.SYS under FreeDOS, RXCONFIG.SYS for RxDOS, and CONFIG.PTS in PTS-DOS.

Although both CONFIG.SYS and AUTOEXEC.BAT exist in the root directories of Windows 95 and 98 boot drives, they are usually left empty. In contrast, Windows Me does not process CONFIG.SYS during startup; instead, it loads environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

Within the context of FlexOS, CONFIG.SYS is a binary configuration file that specifies resource managers and device drivers to be loaded at boot time.

Example

Here is a sample CONFIG.SYS file for MS-DOS version 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>

:;*?!

Establishes labels within CONFIG.SYS to serve as jump targets for , , , , and commands.
Functions similarly to , but additionally supports in-line comments following other CONFIG.SYS instructions. (In MS-DOS/PC DOS, inline comments enclosed in double quotes are not ignored.)
Introduces in-line comments used together with the ; directive.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS does not offer customizable messages but allows conditional processing through boot menus.) Starting with DOS 6.0, comparable functionality is achieved by appending after directives.
Executes the next CONFIG.SYS command without conditions.

ATemplate:NbndC

Determines whether programs can be interrupted upon encountering errors.
Defines which drives record file access dates within FAT file systems.
Enables conditional execution on AT-compatible hardware.
Boot manager utility.
Adjusts the level of detail in error message reporting.
Alters the default serial device driver assigned to the AUX: device.
Restricts character device availability outside the phantom \DEV directory.
Loads a fundamental device driver into memory.
Produces a brief beep even if audible alerts are disabled via switches.
Specifies the operating system to boot next.
Enables or disables extended Ctrl+C checking functionality.
Sets the quantity of disk buffers allocated.
Similar to BUFFERS but allocates buffers within HMA or UMB memory areas.
, CACHETTL, CACHEFLUSH (Embedded DOS 6-XL only)
Manage cache allocation parameters and flush timing.
Loads programs during CONFIG.SYS processing and runs them in the foreground, pausing further processing until completion.
(DR-DOS 7.02+)
Adjusts keyboard Caps Lock state.
, CDDBUFFERS (PTS-DOS only)
Configures CD-ROM driver settings and buffer sizes.
(DR DOS 5.0+, Embedded DOS)
Continues processing CONFIG.SYS from a separate file or label.
, CLS, CODEPAGE, CMOSADDR, COLOR (PTS-DOS or OS/2 specific)
Configure screen clearing, OEM codepages, CMOS RAM address settings, and boot menu color schemes respectively.
, COM2, COM3, COM4 (DR-DOS 7.02+)
Define count, sequence, I/O addresses, and timeout durations for serial COM ports.
, COMMENT(S), COUNTRY
Specify DMA buffer for COMAREA (PTS-DOS), redefine inline comment characters or ignore lines depending on OS, and enable or configure internationalization support respectively.
, CPSW, CPU*, CPU386} series
Set cursor positions, enable codepage switching support, and execute conditionally based on CPU type or speed (varies by operating system).

DTemplate:NbndF

Controls relocation of drive descriptor tables in memory.
Defines memory segment address for multi-sector disk data deblocking operations.
Activates internal debugger capabilities.
Boot manager utility.
Loads device drivers into conventional memory.
Loads device drivers into upper memory areas (equivalent to in DRDOS 5.0).
Sets country and codepage information for keyboard, screen, and printer devices.
Configures cache memory sizes for improved performance.
Selects floppy disk compatibility mode settings.
Specifies display font preferences.
Manages loading of DOS into high memory and utilization of upper memory blocks.
Loads DOS system tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory regions.
Defines an alternative directory path for DOS system files.
Specifies search paths for data files during operation.
Details physical parameters for disk drives.
Sets configuration parameters for drives not recognized by default.
Refer to .
Enables specification of drives for PDUMP.nnn error log files.
Outputs a message on-screen during processing.
Displays messages incorporating ANSI escape sequences for formatting effects.
Adds extra verification steps when launching programs.
Assigns assumed error or return codes for subsequent tasks.
Controls A20 gate state upon program startup.
Terminates CONFIG.SYS processing prematurely except for SWITCHES and SHELL directives under certain conditions.
Defines hash table size used to accelerate file open operations, differing from MS-DOS/PC DOS FASTOPEN driver implementation.
Sets number of cached File Control Blocks (FCBs) that can be open simultaneously (shares buffer space with FILES under DR-DOS).
Similar to FCBS but explicitly loads buffers into upper memory segments.
Boot manager utility.
Specifies maximum number of concurrently open files allowed by the system.
Analogous to FILES but explicitly loads file handles into upper memory segments.
Includes execution of designated CONFIG.SYS subsections (see IGNORE).

GTemplate:NbndI

Waits for a key press 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 specified label.
Continues nested CONFIG.SYS processing at a designated label, then returns to the previous point.
Refer to , , or for additional details.
Consult for further information.
See for related commands.
Refer to or for more context.
See or as applicable.
Refer to for related functionality.
Loads a terminate-and-stay-resident (TSR) program into memory after relocating the DOS data segment. Compare with INSTCDEX.
Consult , , or for further guidance.
See for more details.
Refer to or as needed.
Activates console and command-line history buffer with advanced pattern searching capabilities.
Designates the address of the High Memory Area (HMA) segment.
Configures the HLT (halt) energy-saving mode.
Specifies whether system boot sector virus checking is enabled.
Loads installable file system drivers.
Prevents execution of particular subsections within CONFIG.SYS.
Permits certain applications to execute at ring 2, allowing direct hardware input/output access.
Incorporates directives from another menu block, emulated via GOSUB/RETURN in DR-DOS environments.
Sets the keyboard Insert mode on or off.
Installs TSR programs into memory.
Loads TSR programs into upper memory areas (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSR programs post DOS data segment relocation, similar in function to INSTALL.
Adjusts PIC interrupt priority levels to prioritize a specified IRQ.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the relocated address of the keyboard buffer.
Sets the maximum number of accessible drives supported by the system.
Functions like LASTDRIVE but additionally loads the Current Directory Structure into upper memory.
Lists directories where DLL files are searched for.
Controls compatibility handling for legacy software applications.
Determines the number of file locks allowed concurrently.
Configures support for boot logos and startup message displays.
Sets parameters such as count, order, I/O address, and timeout for the LPT1 port device.
Applies similar configuration settings for the LPT2 port device.
Configures LPT3 port device with analogous options.
Enables and sets up the LPT4 port device parameters.
Establishes wait duration before increasing process priority levels.
Defines strategy used for memory allocation management.
Specifies default DOS memory allocation approach.
Declares menu option entries within CONFIG.SYS menus.
Sets color schemes for menu displays (can be emulated under DR-DOS).
Assigns default menu block selection (emulatable under DR-DOS).
Defines individual menu blocks (emulated in DR-DOS environments).
Enables operations involving multitrack disk access.
Continues processing CONFIG.SYS from a separate file, optionally loading a device driver and setting the %NEWFILE% environment variable.

NTemplate:NbndQ

Defines the default character representing No () in Yes/No/Resume prompts.
Sets status of keyboard [[Num Lock|Template:Keypress]] key as enabled or disabled at startup.
Executes commands conditionally based on the last error code encountered, e.g., .
Displays a message and waits for user key press, similar to and commands in DR-DOS systems.
Requires user confirmation to acknowledge errors detected within CONFIG.SYS processing.
Configures buffer sizes allocated to LPT port devices.
Enables conditional execution on PC-compatible hardware platforms.
Sets parameters governing priority scheduling behavior.
Specifies priority levels assigned to disk I/O processes.
Changes default printer device driver assignment (e.g., switching from LPT1 to LPT3 or LPT4).
Restricts execution of certain DOS programs under specified conditions.
Loads a user interface shell environment during startup.
Enables conditional execution on IBM PS/1-compatible machines only.
Allows conditional execution on IBM PS/2-compatible systems exclusively.
Suppresses output display sent to standard output (STDOUT).

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS files.
Allocates drive letters specifically for local block device drivers.
Defines the default character used for Resume () prompts in Yes/No/Resume dialogs.
Allows nested CONFIG.SYS processing to return control to the previous GOSUB or SWITCH statement, optionally passing back a return code.
Sets the size of real mode memory available.
Enables simultaneous loading of multiple programs in CONFIG.SYS by running them in the background.
Determines whether the initial character of deleted files is retained in FAT directory entries.
Specifies video modes for FreeDOS or screen access methods for PTS-DOS.
Controls the on/off state of the keyboard Scroll Lock key.
Assigns environment variables.
Loads the command interpreter shell.
Functions similar to SHELL but allows specifying a pre-allocated size for COMMAND.COM within HMA or UMBs to minimize fragmentation.
Sets keyboard modifier keys such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines if files should be closed automatically when Ctrl+Alt+Del is pressed.
Configures whether POST routines are bypassed during reboot.
Specifies the number of hardware interrupt stacks allocated.
Defines default stack size allocated to new threads.
Similar to STACKS but loads buffers into upper memory areas instead.
Provides boot manager settings.
Manages behavior of the XMS A20 gate.
Defines submenu blocks (with emulation possible under DR-DOS).
Redirects error logs to a drive rather than displaying popups.
Indicates location for swap file storage.
Enables conditional continuation of nested CONFIG.SYS processing based on key presses, with RETURN resuming previous execution points.
Sets the default switch character, either '/' or '-'.
Specifies special configuration options.
Enables a fix addressing an FPU rounding error.
Selects an alternative DOS system filename for booting purposes.
Determines memory locations for DOS components.
Loads system files from alternate disk areas.
Defines the size of the system memory pool used for dynamic allocation tasks.
Loads DOS data and code into upper memory blocks (UMBs).
Sets the maximum number of concurrent threads allowed.
Configures timeouts for CONFIG.SYS single-step execution and default responses for prompts and SWITCH selections.
Adjusts minimum and maximum scheduler time slice durations.
Specifies the extension used for temporary files.
Globally or locally enables/disables single-step execution of CONFIG.SYS and AUTOEXEC.BAT, with behavior differing across operating systems.
Defines the size of the TRACE log buffer.
Records detailed error information when system traps occur.

UTemplate:NbndZ

Assigns a specific memory segment to serve as an Upper Memory Block (UMB) in DOS.
Sets parameters for the UMB server management.
Defines address ranges allocated to UMB RAM areas.
Enables or disables verification of disk writes to ensure data integrity.
Reports a specified DOS version number to applications.
Configures VGA display status settings.
Sets the current video mode, analogous to FreeDOS's SCREEN command functionality.
Activates usage of virtual DMA channels.
Controls processor Virtual Mode Extensions (VME) capabilities.
Configures VxD driver parameters for Windows environments.
Adjusts Windows system support settings within DOS context.
Relocates the Extended BIOS Data Area (XBDA) to a different memory location.
Enables conditional execution tailored for XT-compatible hardware platforms.
Activates built-in support for Year 2000 compliance issues.
Defines the default character used for affirmative responses in prompts.
Manages tracking settings for file deletions.

Issues

Although the system can start without CONFIG.SYS or AUTOEXEC.BAT, these files play a crucial role in tailoring DOS functionality and enabling support for various software applications. When these files are missing or damaged, troubleshooting becomes necessary.

If the SHELL directive is absent from CONFIG.SYS, or if the file itself is corrupted or missing, DOS attempts to locate COMMAND.COM in the boot drive's root directory. Earlier versions prior to MS-DOS 6.0 will fail to boot if COMMAND.COM is not found. In contrast, MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later will prompt the user to enter a path to a command interpreter. This prompt also appears when COMMAND.COM terminates unexpectedly or exits intentionally, allowing for a limited shell replacement during runtime without needing to reboot.

Because of compatibility issues between MS-DOS 7.x’s COMMAND.COM and DR-DOS, versions 7.02 and later of DR-DOS prevent bypassing SHELL directives when using skip or trace modes to avoid startup failures. If no SHELL directive is detected while skipping CONFIG.SYS processing, users must specify a valid shell before COMMAND.COM loads.

Under MS-DOS and PC DOS, CONFIG.SYS files are generally restricted to a few kilobytes in size (up to 64 KB in more recent editions). Conversely, DR-DOS does not impose a practical size limit because it parses the file line by line rather than tokenizing it. This method offers greater flexibility in managing driver and TSR loading sequences and permits conditional execution based on hardware detection, key presses, errors, or return codes from software—features that assist in resolving conflicts or incorporating debugging utilities.

For MS-DOS/PC DOS versions 2.0 through 4.01, the SHELL command line was limited to 31 characters; subsequent releases expanded this allowance to 128 characters. DR-DOS supports even longer lines up to 255 characters. It is important to note that none of the CONFIG.SYS commands accommodate long filenames.

Dual booting DOS and Windows 9x

When Windows 95 is installed over an existing DOS/Windows environment, it renames CONFIG.SYS and AUTOEXEC.BAT as CONFIG.DOS and AUTOEXEC.DOS respectively to enable dual-boot functionality. During boot into DOS mode, these backup files are temporarily restored under their original names. Windows 95 system configurations are saved under CONFIG.W40 and AUTOEXEC.W40.

In setups where Caldera DR-DOS 7.02 or 7.03 coexists with Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT files remain untouched. Instead, DR-DOS utilizes separate configuration files named DCONFIG.SYS and AUTODOS7.BAT for its startup routines.

OS/2 / Windows NT

OS/2 depends extensively on CONFIG.SYS for configuring system parameters, loading drivers, and setting environment variables prior to launching its graphical user interface.

Within the OS/2 subsystem integrated into Windows NT, the settings traditionally stored in CONFIG.SYS are represented as registry entries rather than physical configuration files.

OS/2 includes numerous undocumented CONFIG.SYS commands that reflect its advanced and intricate configuration requirements.

CONFIG.SYS continues to serve as a fundamental component within OS/2-based operating systems such as eComStation and ArcaOS.

See also

External links

  • AUTOEXEC.BAT and CONFIG.SYS details at Computer Hope
  • Overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS commands (archived)
  • Caldera’s CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
  • FreeDOS CONFIG.SYS command descriptions (archived)
  • PTS-DOS 2000 Pro User Guide with CONFIG.SYS directives (archived)
  • German unofficial PTS-DOS FAQ (PTS/FAQD) including CONFIG.SYS commands (archived)