Jump to content

SWAPPATH (CONFIG.SYS directive)

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

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

Usage

The instructions contained within CONFIG.SYS are responsible for setting up DOS to manage hardware devices, software applications, and memory allocation. Once these commands are executed, DOS initiates the command interpreter designated on the SHELL line; if none is specified, it defaults to COMMAND.COM, which then runs the AUTOEXEC.BAT script.

Primarily, CONFIG.SYS is composed of name=value pairs that adjust system parameters or load essential files, predominantly device drivers and terminate-and-stay-resident programs (TSRs), into memory. This file is located in the root directory of the bootable drive.

Certain DOS variants employ alternative configuration filenames that take precedence over CONFIG.SYS:

- Advanced iterations of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, among others, utilize CCONFIG.SYS or CCONFIG.INI, with supplementary settings stored in a binary file named CCONFIG.BIN. These configurations are typically managed via CONFIG.EXE. - In DR DOS 3.31 and later releases—including Novell DOS 7 and OpenDOS—the DCONFIG.SYS file overrides CONFIG.SYS, supporting multi-boot configurations and disk compression handling. - Versions such as OpenDOS 7.01 and DR-DOS 7.02 also acknowledge ODCONFIG.SYS or DRCONFIG.SYS files. - Starting with DR-DOS 6.0, users can modify default system file extensions using SYS /DR:ext, allowing multiple sets of system files to coexist and be selected through boot loaders like LOADER. - The SHELL directive permits specifying alternative AUTOEXEC filenames; in these cases, COMMAND.COM accepts extensions other than ".BAT". - The CHAIN=filespec command enables continuation of configuration processing from additional files, optionally targeting specific labels within those files.

Other DOS-compatible systems use distinct configuration filenames: FreeDOS relies on FDCONFIG.SYS, RxDOS uses RXCONFIG.SYS, and PTS-DOS employs CONFIG.PTS for similar configuration roles.

In Windows 95 and Windows 98, CONFIG.SYS and AUTOEXEC.BAT files are present but usually remain empty. Windows Me does not process CONFIG.SYS during startup; instead, it loads environment variables directly from the registry path:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

For FlexOS, CONFIG.SYS is a binary file that defines resource managers and device drivers.

Example

Here is a sample CONFIG.SYS configuration used in 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 that function as jump points for directives such as , , , and .
Functions similarly to , also serving to add inline comments after other CONFIG.SYS commands. (Note that MS-DOS/PC DOS does not ignore inline comments enclosed in double quotes.)
Used at the start of inline comments alongside the ; directive.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands.[1] (FreeDOS supports conditional execution with boot menus but lacks customizable messages.) From DOS 6.0 onward, this feature can be achieved by appending after directives, e.g., .
Forces unconditional execution of the following CONFIG.SYS command.

ATemplate:NbndC

Determines whether programs may be terminated upon encountering errors.
Sets which drives record file access timestamps in FAT file systems.
Enables conditional execution on AT-compatible hardware.
Manages boot loading operations.
Adjusts the verbosity level of error reporting.
Alters the default serial port driver (COM1 to COM4) for the AUX device.
Prevents character devices from being accessible outside the phantom \DEV directory.
Loads a fundamental device driver into system memory.
Produces a brief beep even if sound alerts are disabled.
Defines the operating system to be booted next.
Enables or disables extended Ctrl+C detection.
Sets the number of disk buffers to be allocated.
Similar to BUFFERS, but loads buffers into HMA or UMB areas.
, CACHETTL, CACHEFLUSH (Exclusive to Embedded DOS 6-XL)
Controls cache block allocation, lifespan, and flushing intervals.
Loads programs specified in CONFIG.SYS and pauses processing until they return.
Sets the Caps Lock key status on the keyboard.
, CDDBUFFERS (PTS-DOS exclusive)
Configures CD-ROM driver parameters and buffer quantity.
Continues processing CONFIG.SYS from a new file or label.
, CLS, CODEPAGE (various OS-specific)
Configure system clock types, clear the display, and define OEM codepages.
, COLOR (PTS-DOS only)
Sets CMOS RAM addresses and boot menu color schemes.
, COM2, COM3, COM4 (DR-DOS 7.02+)
Defines counts, logical sequences, I/O addresses, and timeouts for serial ports.
, COMMENT(S), COUNTRY (various OS versions)
Specifies DMA buffers, redefines comment characters, or activates international support.
, CPSW (various OS versions)
Adjusts display cursor position and enables codepage switching support.
, CPU88, CPU88+, CPU86, CPU86+, CPU286, CPU286+, CPU386, CPU386+, CPU486, CPU486+ (PTS-DOS and DR-DOS)
Executes conditionally based on processor type or speed.

DTemplate:NbndF

Adjusts relocation of drive descriptor tables in memory.
Defines the memory segment limit up to which multi-sector disk data deblocking is permitted.
Activates internal debugger functionality.
Manages boot loading processes.
Loads a device driver into memory space.
Loads a device driver into upper memory area (equivalent to in DRDOS 5.0).
Configures country and codepage settings for keyboard, screen, and printer devices.
Sets cache memory sizes for system optimization.
Defines floppy disk compatibility modes.
Assigns display font preferences.
Specifies loading of DOS into high memory area and/or usage of upper memory blocks.
Loads DOS system tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory regions.
Specifies an alternative path location for DOS system files.
Sets search paths for data files used by DOS.
Defines physical parameters for disk drives connected to the system.
Establishes parameters for drives that are not recognized automatically.
Refer to for additional information.
Enables error logging with PDUMP.nnn files and assigns drive location for logs.
Displays a text message on the screen during startup or processing.
Outputs messages including ANSI escape sequences to enhance display features.
Determines whether extra verification steps occur when launching programs.
Specifies an expected error or return code following program execution.
Sets the A20 gate state at program startup to control address line behavior.
Terminates CONFIG.SYS processing before reaching file end (except under certain conditions for SWITCHES and SHELL).
Defines hash table size to accelerate file opening operations (distinct from MS-DOS/PC DOS FASTOPEN driver).
Specifies how many File Control Blocks can be cached simultaneously (shares buffer space with FILES under DR-DOS).
Similar to FCBS but explicitly loads FCBs into upper memory areas.
Manages boot loading functions within the system configuration.
Sets the maximum number of files that can be opened at once by the operating system.
Equivalent to FILES but explicitly loads file handles into upper memory blocks.
Executes specified subsections within CONFIG.SYS as defined by IGNORE directives.

GTemplate:NbndI

Waits for a key press or timeout, assigning the error level to the ASCII value of the key pressed or 1024 if timed out.
Resumes CONFIG.SYS processing at a designated label.
Continues nested CONFIG.SYS execution at a specified label, returning afterward to the original point.
Refer to , , or for additional details.
Consult for further information.
See for related commands.
Refer to or as applicable.
Consult or for more guidance.
See .
Loads a TSR program into memory after relocating the DOS data segment. Compare with INSTCDEX.
Refer to , , or for related options.
See .
Consult or for additional details.
Activates console and command line history buffer with advanced pattern search capabilities.
Defines the address of the HMA (High Memory Area) segment.
Configures the HLT instruction energy-saving mode.
Performs boot sector virus checks during system startup.
Loads installable file system drivers.
Prevents execution of specified sections within CONFIG.SYS.
Permits certain programs to execute at ring 2, allowing direct hardware I/O access.
Incorporates directives from another menu block, emulated via GOSUB/RETURN in DR-DOS.
Sets the status of keyboard Insert mode.
Installs a TSR program into memory.
Installs a TSR application into upper memory, similar to HIINSTALL in DR DOS 5.0.
Installs a TSR program post DOS data segment relocation, akin to INSTALL.
Alters PIC controller interrupt priorities, assigning highest priority to a specified IRQ number.

KTemplate:NbndM

Determines the keyboard layout configuration.
Specifies the location of the relocated keyboard buffer in memory.
Sets the maximum number of accessible drive letters.
Functions like LASTDRIVE but additionally loads Current Directory Structure into upper memory.
Defines search paths for DLL files.
Handles compatibility settings for legacy software.
Specifies the maximum number of file locks allowed.
Configures boot logo display using PTS-DOS boot manager features.
Sets parameters including count, order, I/O address, and timeout for the LPT1 device port.
Mirrors LPT1 settings for LPT2 device port configuration.
Mirrors LPT1 settings for LPT3 device port configuration.
Enables and configures the LPT4 device port functionality.
Establishes priority wait times for processes in the system scheduler.
Configures overall memory allocation strategy parameters.
Sets default DOS memory allocation behavior.
Defines menu options available within the system interface.
Specifies color schemes for menus, which can be emulated in DR-DOS environments.
Sets default menu blocks, emulatable within DR-DOS systems.
Defines individual menu blocks used in DR-DOS emulation scenarios.
Enables operations involving multitrack disk access methods.
Continues CONFIG.SYS processing using a new file after loading drivers and setting the %NEWFILE% environment variable.

NTemplate:NbndQ

Defines the default No () response character in Yes/No/Resume prompts.
Controls the status of the keyboard’s [[Num Lock|Template:Keypress]] key upon startup.
Enables conditional command execution based on error level codes, such as .
Displays a message and waits for a keystroke, similar to DR-DOS's and commands.
Requires user confirmation to acknowledge errors encountered during CONFIG.SYS processing.
Sets buffer sizes for parallel ports LPT1 through LPT3 to optimize data flow.
Allows conditional execution of commands on PC-compatible machines only.
Configures process scheduling priority levels within the operating system scheduler.
Assigns disk I/O priority settings to specific programs for optimized performance.
Changes default printer device driver assignment among LPT1 through LPT4 ports.
Specifies whether DOS applications are permitted to run on the system.
Loads a user interface shell environment during startup sequences.
Enables conditional command execution on IBM PS/1-compatible hardware platforms only.
Enables conditional command execution on IBM PS/2-compatible systems exclusively.
Suppresses output display directed to STDOUT during command execution.

RTemplate:NbndT

Activates automatic reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS (ignored by PTS-DOS).
Allocates a drive letter, preventing assignment to local block devices.
Sets the default character to resume () in command prompts.
Returns control from nested CONFIG.SYS processing to the prior GOSUB or SWITCH statement, optionally passing back a return code.
Defines the amount of real mode memory available.
Loads programs specified in CONFIG.SYS simultaneously in the background, similar to CALL or INSTALL commands under DOS.
Determines whether the initial character of deleted files is stored in the FAT reserved area.
Specifies video mode for FreeDOS or screen access methods under PTS-DOS.
Configures the Scroll Lock key status on the keyboard.
Sets environment variables for the system.
Loads the command interpreter shell.
Functions like SHELL but allows preloading COMMAND.COM into HMA or UMBs to minimize fragmentation.
Defines keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Controls whether files close upon pressing Ctrl+Alt+Del.
Skips the Power-On Self-Test (POST) during reboot sequences.
, STACKSIZE, STACKSHIGH
Configure hardware interrupt stacks and buffer locations across various DOS releases.
, SYSBOOT, SYSGEN, SYSLOAD
PTS-DOS-specific commands for managing boot processes and system loading addresses.
Directive introduced in DOS 6.0+ to handle submenu blocks (unsupported by DR-DOS or FreeDOS).
, SWAPPATH, THREADS, TIMESLICE
OS/2 directives managing error logging, swap file locations, threading capabilities, and CPU scheduling slices.
, SWITCHES
Options enabling conditional processing within CONFIG.SYS for DR DOS and Novell DOS systems.
, TMPEXT
Sets default switch characters and temporary file extensions across different DOS variants.
, TRACEBUF
Enables or disables single-step execution of CONFIG.SYS with adjustable log buffer sizes (behavior varies between DOS and OS/2).
OS/2 directive providing detailed error logging functionality.

UTemplate:NbndZ

Configures DOS to treat a specified segment as Upper Memory Block (UMB).
Selects which UMB server is utilized by the system.
Defines address ranges designated as UMB memory areas.
Enables or disables verification of disk write operations.
Specifies the version of DOS reported to applications.
Manages VGA display status settings.
Indicates current video mode configuration.
Determines if virtual DMA access is permitted.
Controls processor Virtual Mode Extensions (VME) features.
Configures VxD drivers for Windows environments.
Sets up system support parameters for Windows operation.
Manages relocation settings for the Extended BIOS Data Area (XBDA).
Enables conditional execution on XT-compatible hardware platforms.
Activates built-in Year 2000 compliance support.
Defines the default affirmative response character in user prompts.
Configures tracking behavior for file deletions.

Issues

Although a system can successfully boot without CONFIG.SYS or if it becomes corrupted, this file—together with AUTOEXEC.BAT—is critical for comprehensive boot customization and meeting software prerequisites. When these files are damaged, troubleshooting becomes necessary.

If CONFIG.SYS is missing a SHELL directive or is corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Earlier DOS versions prior to 6.0 will fail to boot without this file. In contrast, MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later will prompt users to enter a path to a command processor. This prompt also appears if the primary command interpreter terminates or exits intentionally, allowing limited runtime replacement of the shell without rebooting.

Due to incompatibilities between MS-DOS 7.0+ COMMAND.COM and DR-DOS, versions of DR-DOS from 7.02 onward prevent bypassing SHELL directives during certain skip or trace modes. If no valid shell filename is found before loading COMMAND.COM from the root directory, users are prompted accordingly.

CONFIG.SYS size constraints differ among operating systems: MS-DOS and PC DOS limit CONFIG.SYS size up to 64 KB in most recent editions, whereas DR-DOS imposes no practical maximum because it interprets directives line-by-line rather than compiling them. This approach grants DR-DOS enhanced flexibility over driver and TSR loading sequences, conditional execution based on hardware detection or error states, and integration of non-resident software components via INSTALL.

In MS-DOS/PC DOS versions 2.0 through 4.01, the SHELL directive was restricted to 31 characters. Later versions expanded this limit to 128 characters, while DR-DOS supports up to 255 characters. It is important to note that CONFIG.SYS directives do not accommodate long filenames.

Dual Booting DOS and Windows 9x

When installing Windows 95 over a pre-existing DOS/Windows environment, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS respectively. This adjustment enables dual boot functionality between Windows 9x and DOS. Selecting the DOS boot option temporarily reinstates these files as CONFIG.SYS and AUTOEXEC.BAT. Meanwhile, backups of the Windows 95 versions are preserved under the names CONFIG.W40 and AUTOEXEC.W40.

In cases where Caldera DR-DOS 7.02/7.03 is installed alongside Windows 95, the original CONFIG.SYS and AUTOEXEC.BAT files used by Windows remain untouched. Instead, DR-DOS employs alternative startup files named DCONFIG.SYS and AUTODOS7.BAT.

OS/2 / 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 included in Windows NT, what OS/2 applications recognize as CONFIG.SYS is actually managed within the system registry.

There are many CONFIG.SYS commands specifically designed for OS/2 that are not officially documented.

CONFIG.SYS continues to be utilized by OS/2-based 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
  • Details on FreeDOS CONFIG.SYS commands
  • User manual for PTS-DOS 2000 Pro including a review of CONFIG.SYS directives
  • Unofficial German PTS-DOS FAQ (PTS/FAQD) featuring additional CONFIG.SYS commands
  1. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Paul_2000_CONFIG