Jump to content

WINDOWS (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article WINDOWS (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 20251 source
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983
ProductsSystem configuration directives for DOS and OS/2

CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, contains setup commands processed by the operating system's DOS BIOS—commonly found in IBMBIO.COM or IO.SYS—during the system startup sequence. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS configure DOS to recognize devices, applications, and memory management utilities. Once CONFIG.SYS is interpreted, DOS initiates the command interpreter specified by the SHELL directive, defaulting to COMMAND.COM if none is provided. Subsequently, the command interpreter executes the AUTOEXEC.BAT script.

This configuration file primarily contains name=value pairs that define parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs). CONFIG.SYS is located in the root directory of the bootable drive.

Certain DOS distributions search for alternative configuration filenames that take precedence over CONFIG.SYS:

- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 prioritize CCONFIG.SYS or CCONFIG.INI (in Multiuser DOS) and MCONFIG.SYS (in REAL/32). These support more complex settings stored in binary files like CCONFIG.BIN, which are typically edited using CONFIG.EXE.

- In DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, and DR-DOS versions 7.02 and later, DCONFIG.SYS supersedes CONFIG.SYS, enabling multi-boot configurations and disk compression management. These variants also recognize filenames such as ODCONFIG.SYS or DRCONFIG.SYS.

- Starting with DR-DOS 6.0, users can specify custom default extensions via SYS /DR:ext, allowing multiple system file sets to coexist and be selected through boot loaders like LOADER. The SHELL directive supports an optional parameter /P[:filename.ext] for choosing alternative AUTOEXEC.BAT files, a feature also supported by 4DOS. The CHAIN=filespec command permits continuation of processing from another configuration file, including jumping to specific labels in DR-DOS 7.02 and newer.

- DR-DOS 7.03 introduced SYS /A, which copies both CONFIG.SYS and AUTOEXEC.BAT alongside system files during setup.

Other DOS variants provide similar functionality with alternate filenames: FDCONFIG.SYS in FreeDOS, RXCONFIG.SYS in RxDOS, and CONFIG.PTS in PTS-DOS.

Windows 95 and Windows 98, which are DOS-based systems, retain CONFIG.SYS and AUTOEXEC.BAT on their boot drives but generally leave these files empty. In contrast, Windows Me does not process CONFIG.SYS at startup; instead, environment variables are loaded directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

Within the FlexOS operating system, CONFIG.SYS is a binary file that specifies resource managers and device drivers loaded during boot.

Example

Below is a sample CONFIG.SYS 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 that serve as jump targets for directives such as , , , , and .
Functions similarly to , also used to add inline comments following other commands. (Note that under MS-DOS/PC DOS inline comments inside double quotes are not ignored.)
Begins inline comments alongside the ; directive.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands.[1] (FreeDOS lacks customizable messages but supports conditional boot menus using and .) Starting with DOS 6.0, similar behavior can be achieved by appending after commands like or , a feature also present in DR DOS.
Executes the following CONFIG.SYS instruction unconditionally.

ATemplate:NbndC

Determines whether programs terminate upon encountering errors.
Sets which drives record file access timestamps in FAT file systems.
Enables conditional command execution on AT-compatible hardware.
Manages boot selection.
Adjusts the level of detail shown in 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 memory.
Produces a brief beep sound even if audible alerts are disabled.
Selects the operating system to boot next.
Enables or disables extended Ctrl+C detection.
Sets the quantity of disk buffers allocated.
Similar to BUFFERS but allocates buffers within HMA or UMB regions.
, CACHETTL, CACHEFLUSH (Embedded DOS 6-XL only)
Controls cache block allocation and flushing intervals.
Executes programs specified in CONFIG.SYS, pausing further processing until completion.
(DR-DOS 7.02+)
Toggles Caps Lock key status on the keyboard.
, CDDBUFFERS (PTS-DOS only)
Defines CD-ROM driver name and buffer count.
(DR DOS 5.0+, Embedded DOS)
Continues processing CONFIG.SYS from a new file or label.
, CLS, CODEPAGE (various OS versions)
Manage system clock type, clear screen, and set OEM codepages.
(DR-DOS 7.02+)
Configures COM port quantity, sequence, I/O addresses, and timeouts.
, COMMENT(S), COUNTRY, CPOS, CPSW (various OS versions)
Handle DMA buffers, inline comments, localization, cursor positioning, and codepage switching.
CPU-specific directives (PTS-DOS only) allow conditional execution based on CPU model and speed (e.g., CPU88, CPU386+).

DTemplate:NbndF

Adjusts relocation of drive descriptor tables in memory.
Defines memory segment address for multi-sector disk data deblocking operations.
Activates internal debugger support features.
Controls boot management functions.
Loads a device driver into standard memory areas.
Loads device driver into upper memory blocks (equivalent to in DRDOS 5.0).
Sets country and codepage configurations for keyboard, screen, and printer devices.
Configures cache size parameters for system memory.
Specifies floppy disk compatibility settings.
Defines display font used by the system.
Controls loading DOS into high memory area and/or utilization of upper memory blocks.
Loads DOS internal tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory regions.
Specifies alternative directories for DOS system files.
Defines search paths for data files used by the system.
Specifies physical parameters for disk drives.
Sets parameters for drives not recognized by default configurations.
Refer to .
Enables PDUMP.nnn error logging and assigns target drive for logs.
Outputs a message directly to the display screen.
Displays messages including ANSI escape sequences for formatting.
Adds extra verification steps when launching programs.
Defines assumed error or return codes for subsequent commands.
Configures A20 gate state when initiating program execution.
Terminates CONFIG.SYS processing prematurely except for certain SWITCHES and SHELL commands.
Sets hash table size to optimize file opening speed, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
Specifies number of cached File Control Blocks (FCBs) allowed open simultaneously (shares buffer space with FILES under DR-DOS).
Similar to FCBS but loads these into upper memory areas.
Boot management directive controlling boot options.
Determines maximum number of files that can be opened at once.
Same as FILES but loads open file handles into upper memory blocks.
Executes specified subsections within CONFIG.SYS (see IGNORE).

GTemplate:NbndI

Awaits keypress or timeout, sets error level to ASCII value or 1024 if timed out.
Resumes processing of CONFIG.SYS at the designated label.
Initiates nested CONFIG.SYS processing at a given label; returns control to previous point.
Refer to , , or for additional details.
Consult for further information.
See for related commands.
Refer to or for more context.
See or for complementary directives.
Consult for usage guidance.
Loads a TSR program into memory following DOS data segment relocation. Compare with INSTCDEX.
See , , or for related options.
Refer to for further instructions.
See or for extended functionality.
Activates console and command line history buffer with enhanced pattern matching capabilities.
Defines the address of the HMA segment.
Configures energy-saving mode using HLT instruction.
Enables scanning of boot sector viruses.
Loads installable file system drivers.
Prevents execution of specific subsections within CONFIG.SYS.
Permits programs to execute at ring 2 level, allowing direct hardware I/O access.
Incorporates directives from a separate menu block (emulated via GOSUB/RETURN in DR-DOS).
Sets the Insert mode status on the keyboard.
Installs a TSR program into memory.
Loads a TSR program into upper memory (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSR after relocating DOS data segment. Compare with INSTCDEX.
Rotates PIC interrupt priorities to assign highest priority to specified interrupt number.

KTemplate:NbndM

Defines the keyboard layout to be used.
Specifies relocated address for keyboard buffer storage.
Sets the maximum number of accessible drives.
Similar to LASTDRIVE but loads Current Directory Structure (CDS) into upper memory area.
Establishes search paths for DLL files.
Manages backward compatibility with legacy applications.
Determines the number of file locks allowed.
Configures boot logo display when using PTS-DOS boot manager.
Specifies count, sequence, I/O port address, and timeout settings for LPT1 device.
Specifies count, sequence, I/O port address, and timeout settings for LPT2 device.
Specifies count, sequence, I/O port address, and timeout settings for LPT3 device.
Enables and configures LPT4 device similarly to prior LPT devices.
Defines delay before increasing process priority level.
Sets strategy for memory allocation management.
Establishes default method for DOS memory allocation.
Defines menu option selections.
Specifies color scheme for menus (emulatable within DR-DOS).
Sets default menu block (can be emulated under DR-DOS).
Defines a menu block structure (emulatable under DR-DOS).
Enables or disables multitrack disk operations support.
Continues CONFIG.SYS processing in a new file after loading a device driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Sets default No () response character in Yes/No/Resume prompts.
Controls keyboard Num Lock state (on or off).
Enables conditional execution based on last error code, e.g., .
Displays message and waits for key press, similar to and commands in DR-DOS.
Requires user confirmation upon encountering errors during CONFIG.SYS processing.
Configures print buffer size for LPT ports output handling.
Executes commands conditionally on PC-compatible systems only.
Sets scheduler priority level for processes.
Adjusts priority specifically for disk I/O operations programs.
Changes default printer device driver assignment (LPT1 through LPT4).
Determines whether DOS programs are allowed to run.
Loads the user interface shell environment.
Enables conditional execution on IBM PS/1-compatible machines only.
Enables conditional execution on IBM PS/2-compatible machines only.
Suppresses display output on STDOUT.

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS files.
Reserves drive letters for local block device drivers.
Establishes the default character for Resume () prompts.
Enables returning from nested CONFIG.SYS processing to the prior GOSUB or SWITCH point, optionally with a return code.
Sets the size of real mode memory available.
Allows simultaneous loading of programs in CONFIG.SYS in the background.
Saves the initial character of deleted files within the FAT reserved area.
Defines video mode settings under FreeDOS and manages screen access methods in PTS-DOS.
Controls the keyboard Scroll Lock status, turning it on or off.
Assigns environment variables.
Loads the command interpreter shell.
Similar to SHELL but includes a size parameter to pre-allocate COMMAND.COM in HMA or UMBs, reducing fragmentation when using third-party shells.
Specifies keyboard modifier keys such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Manages file closure behavior when Ctrl+Alt+Del is pressed.
Skips the Power-On Self-Test (POST) during reboot sequences.
, STACKSIZE, STACKSHIGH
Configure interrupt stack sizes and buffer locations across various DOS systems and derivatives.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
Handle boot manager configurations, alternative operating system boot files, memory placement for DOS components, and loading into UMBs (PTS-DOS).
, SUBMENU, SUPPRESSPOPUPS, SWAPPATH
Govern internal parameters such as submenu blocks (DOS 6+), error logging drives (OS/2), and swap file directory paths respectively.
, SWITCHES, SWITCHAR
Facilitate conditional CONFIG.SYS processing based on keypresses (DR DOS), define special options (Novell DOS), and set default switch characters ('/' or '-') across DOS variants.
, THREADS, TIMESLICE
Adjust FPU bug fixes (OS/2), number of concurrent threads (OS/2), and scheduler time slice durations (OS/2).
, TMPEXT, TRACE, TRACEBUF
Define CONFIG.SYS timeouts (DR DOS, PTS-DOS), temporary file extensions (PTS-DOS), enable single-step execution tracing (DR-DOS, PTS-DOS, OS/2), and configure trace log buffer sizes (OS/2).
, STORAGE
Record detailed error information (OS/2) and manage boot manager settings (PTS-DOS).

UTemplate:NbndZ

Configures DOS to utilize a specified segment as Upper Memory Block (UMB) memory.
Determines which UMB server is employed.
Defines address ranges designated as UMB RAM.
Enables or disables verification of disk writes.
Sets the DOS version that is reported to applications.
Manages VGA display status settings.
Specifies the current video mode similarly to FreeDOS's SCREEN command.
Indicates whether virtual DMA usage is permitted.
Controls deactivation of processor Virtual Mode Extensions (VME).
Configures Virtual Device Driver (VxD) settings for Windows environments.
Sets system support parameters for Windows compatibility.
Adjusts relocation settings for the Extended BIOS Data Area (XBDA).
Enables conditional execution on XT-compatible computers.
Configures built-in Year 2000 compliance support.
Defines the default character used for Yes responses in prompts.
Manages tracking of deleted files.

Issues

Although the system can initiate without CONFIG.SYS or AUTOEXEC.BAT files present, these are critical for comprehensive DOS customization and meeting software prerequisites. Their corruption or absence necessitates troubleshooting measures.

If a SHELL directive is missing from CONFIG.SYS or if the file itself is absent or damaged, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to 6.0 will fail to boot without this file. MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later versions prompt users to provide a command interpreter path instead. This prompt also appears if the primary shell terminates unexpectedly or deliberately exits, allowing limited runtime shell replacement without restarting.

COMMAND.COM from MS-DOS 7.0 onward is incompatible with DR-DOS systems often installed alongside on drive C:. DR-DOS versions 7.02 and above prevent bypassing SHELL directives during skip, trace, or step modes by requiring valid shell input before loading COMMAND.COM from root. Recovery involves re-triggering skip behavior to manage invalid shell argument scenarios.

CONFIG.SYS size restrictions differ: MS-DOS/PC DOS limits file sizes to a few kilobytes—up to 64 KB in recent releases—whereas DR-DOS imposes no effective limit due to line-by-line interpretation rather than tokenization. This grants DR-DOS users full control over driver and TSR loading order via DEVICE and INSTALL commands, facilitating conflict resolution and debugging processes. Additionally, INSTALL supports executing non-resident programs integrated within CONFIG.SYS execution flow.

Maximum length of SHELL command lines has increased over time from 31 characters in MS-DOS/PC DOS versions 2.0 through 4.01 up to 128 characters in later editions. DR-DOS accepts command lines up to 255 characters. Notably, CONFIG.SYS directives do not support long filenames.

Dual Booting 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 alteration supports dual boot functionality between Windows 9x and DOS. Selecting the DOS boot option temporarily reinstates these original filenames. Meanwhile, backup copies of the Windows 95 versions are preserved under the names CONFIG.W40 and AUTOEXEC.W40.

In cases where Caldera DR-DOS 7.02 or 7.03 is installed alongside Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT files remain intact without modification. Instead, DR-DOS utilizes its own 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 variables before initiating its graphical user interface.

Within the OS/2 subsystem found in Windows NT, CONFIG.SYS functions as a configuration stored in the system registry, accessible by OS/2 applications.

A variety of undocumented CONFIG.SYS commands are implemented by OS/2 for system configuration.

The use of CONFIG.SYS continues in OS/2 derivatives such as eComStation and ArcaOS.

See also

External links

  • AUTOEXEC.BAT and CONFIG.SYS details | Computer Hope | 2017-12-29 | [1]
  • Overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS directives | [2]
  • CONFIG.SYS Command Reference | Caldera | 1998 | [3] (DR-DOS 7 configuration directives)
  • Explanation of FreeDOS CONFIG.SYS commands | [4]
  • PTS-DOS 2000 Pro User Guide (includes CONFIG.SYS commands) | [5]
  • Unofficial German PTS-DOS FAQ (2004) covering CONFIG.SYS directives | [6]
  1. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Paul_2000_CONFIG