Jump to content

COM4 (CONFIG.SYS directive)

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

CONFIG.SYS serves as the main configuration file for the DOS and OS/2 operating system families. This particular ASCII text file holds setup instructions that the operating system’s DOS BIOS interprets during the startup sequence. CONFIG.SYS made its debut with DOS version 2.0.

Usage

The commands within CONFIG.SYS customize DOS for hardware devices, software applications, and memory allocation. Once CONFIG.SYS has been processed, DOS launches the command interpreter specified by the SHELL directive or defaults to COMMAND.COM, which subsequently executes AUTOEXEC.BAT.

CONFIG.SYS is primarily composed of name=value pairs that set configurable options or load components such as device drivers and terminate-and-stay-resident programs (TSRs).

Within DOS environments, CONFIG.SYS is located in the root directory of the drive used to boot the system.

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

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

- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 prefer CCONFIG.SYS or CCONFIG.INI, with supplementary settings stored in a binary file named CCONFIG.BIN, typically managed through CONFIG.EXE. - From version 3.31 onwards, DR DOS and its successors such as Novell DOS give priority to DCONFIG.SYS, often utilized alongside disk compression utilities or multi-boot configurations. - Distributions like OpenDOS 7.01 and DR-DOS 7.02 also accept ODCONFIG.SYS or DRCONFIG.SYS as configuration files. - Starting with DR-DOS 6.0, it is possible to modify default system file extensions using SYS /DR:ext, allowing multiple distinct sets of system files to coexist and be selected by boot loaders like LOADER. - The SHELL command can specify alternative AUTOEXEC.BAT files using /P[:filename.ext], a feature supported by tools such as 4DOS. - DR-DOS 6.0 and later versions introduce the CHAIN=filespec[,label] directive, enabling continued processing of additional configuration files, which may reside outside the root directory. - From DR-DOS 7.03 onward, the SYS /A option allows copying CONFIG.SYS and AUTOEXEC.BAT alongside other system files.

In other systems, FreeDOS employs FDCONFIG.SYS, RxDOS 7.24+ uses RXCONFIG.SYS, and PTS-DOS relies on CONFIG.PTS.

Windows 95 and Windows 98, which are built on DOS foundations, retain CONFIG.SYS and AUTOEXEC.BAT on boot volumes but often leave them empty. In contrast, Windows Me bypasses parsing CONFIG.SYS during startup, instead loading environment variables from the Windows Registry.

For FlexOS, CONFIG.SYS is a binary configuration file that specifies resource managers and device drivers loaded at boot time.

Example

Sample CONFIG.SYS content 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 to serve as jump destinations for directives like , , , and .
Functions similarly to , but also supports inline comments following other CONFIG.SYS statements. (Note that in MS-DOS/PC DOS, inline comments are not ignored if enclosed in double quotes.)
Used at the beginning of inline comments alongside ;.
Prompts a Yes/No confirmation with an optional message before executing subsequent CONFIG.SYS commands. (FreeDOS supports optional conditions via boot menus but lacks message support.) (DOS 6.0+ offers a comparable feature through appending a to directives, e.g., .)
Executes the next CONFIG.SYS directive without any condition.

ATemplate:NbndC

Determines whether programs can be interrupted due to errors.
Sets which drives record file access timestamps within FAT file systems.
Enables conditional command execution on AT-compatible hardware.
Manages boot sequence selection.
Adjusts the level of detail shown in error messages.
Alters the default serial port driver assignment (from COM1: through COM4:) for the AUX device.
Restricts access to character devices outside the virtual \DEV directory.
Loads a fundamental device driver into system memory.
Produces an audible beep even when sound alerts are disabled.
Determines the operating system designated for the next boot cycle.
Activates or deactivates extended Ctrl+C interrupt checking.
Defines the quantity of disk buffers allocated.
Similar to BUFFERS but places buffers in HMA or UMB memory areas.
, ,
Controls allocation and flushing timing of cache blocks.
Executes programs within CONFIG.SYS, pausing further processing until completion.
Sets the Caps Lock key status on the keyboard.
,
Configures CD-ROM driver name along with buffer quantity.
Continues processing CONFIG.SYS commands from a new file or label reference.
, , , etc., adjust system clock type, screen clearing behavior, and OEM codepage settings respectively (varies depending on OS version).
, ...,
Defines number, sequence, I/O addresses, and timeout parameters for serial COM ports.

Additional commands regulate device buffer management, internationalization support, CPU-specific conditional execution, among others—customizing system operations to enhance performance across varied hardware platforms.

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Specifies maximum memory segment address for multi-sector disk data deblocking operations.
Enables support for internal debugging tools.
Boot sequence manager.
Loads a device driver into conventional memory.
Loads a device driver into upper memory areas (equivalent to in DRDOS 5.0).
Sets country and codepage configurations for keyboard, screen, and printer devices.
Defines sizes of cache memory allocations.
Selects floppy disk compatibility mode.
Specifies display font settings.
Determines whether DOS loads into high memory area and/or utilizes upper memory blocks (similar functionality to under DRDOS 5.0).
Loads DOS system tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory regions.
Specifies an alternate directory path for locating DOS files.
Sets search paths for data file retrieval.
Details physical characteristics of disk drives.
Establishes parameters for drives not otherwise recognized by the system.
Refer to SWITCH directive for details.
Activates and designates drive location for PDUMP.nnn error logging files.
Outputs a message directly to the display screen.
Displays a message incorporating ANSI escape codes.
Determines whether additional validation occurs when launching programs.
Assigns a specific error or return code to be assumed thereafter.
Configures A20 line gate status during program startup.
Terminates CONFIG.SYS processing prematurely except for SWITCHES and SHELL directives.
Defines hash table size used to accelerate file opening operations (distinct from MS-DOS/PC DOS FASTOPEN driver).
Specifies count of cached File Control Blocks (FCBs) available simultaneously (shares buffer with FILES under DR-DOS).
Similar to FCBS but loads FCBs into upper memory areas.
Boot manager utility.
Sets maximum number of concurrently open files allowed by the system.
Like FILES but loads file handles into upper memory regions.
Allows execution of specified CONFIG.SYS subsections (see IGNORE directive).

GTemplate:NbndI

Waits for a key press or timeout, returning the ASCII code or 1024 if timed out.
Resumes processing of CONFIG.SYS at the given label.
Continues nested CONFIG.SYS execution at a specified label, then returns to the prior position.
Refer to , , or for more details.
Consult for additional information.
See for further reference.
Refer to or as applicable.
See or for related commands.
Consult for more context.
Loads a terminate-and-stay-resident (TSR) program after relocating the DOS data segment, similar in function to .
See , , or for further explanation.
Refer to for additional details.
See or for related usage.
Activates console and command line history buffers with enhanced search capabilities.
Defines the address of the High Memory Area (HMA) segment.
Configures CPU halt (HLT) mode for energy conservation.
Enables checking of boot sector viruses during startup.
Loads installable file system drivers.
Excludes specified subsections of CONFIG.SYS from execution.
Permits designated programs to operate at ring 2, granting direct hardware I/O access.
Incorporates directives from another menu block, emulated via GOSUB/RETURN in DR-DOS environments.
Sets the status of keyboard Insert mode.
Installs TSR programs into conventional memory.
Loads TSR programs into upper memory blocks, equivalent to HIINSTALL in DR-DOS 5.0.
Installs TSR programs post DOS data segment relocation.
Reorders PIC interrupt priorities to raise the priority level of a specified IRQ.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the address of the relocated keyboard buffer.
Sets the maximum number of accessible drives.
Similar to LASTDRIVE but also loads the Current Directory Structure into upper memory areas.
Lists directories searched for DLL files.
Controls handling procedures for legacy applications.
Determines the quantity of file locks allowed.
Configures support for boot logos and startup messages using PTS-DOS boot manager features.
Specifies count, sequence, I/O address, and timeout settings for the LPT1 device port.
Applies identical settings as LPT1 for the LPT2 port.
Mirrors LPT1 configurations for LPT3 device port.
Enables and configures LPT4 device similarly to other LPT ports.
Sets delay duration prior to elevating process priority levels.
Adjusts memory allocation policies and strategies.
Defines default DOS memory allocation methods.
Specifies available menu options within the interface.
Sets color schemes for menus, with emulation possible under DR-DOS systems.
Determines default menu block selection, emulatable in DR-DOS environments.
Defines menu blocks configurations, supported via DR-DOS emulation techniques.
Enables multi-track disk operation capabilities.
Continues CONFIG.SYS processing from a separate file after loading a device driver and setting the %NEWFILE% environment variable.

NTemplate:NbndQ

Sets default character used as No () response in Yes/No/Resume prompts.
Configures keyboard Num Lock state as enabled or disabled by default.
Enables conditional execution based on previous error codes, such as .
Displays text and waits for a key press, comparable to DR-DOS's and .
Requires user confirmation before proceeding when errors occur in CONFIG.SYS processing.
Defines buffer size parameters for LPT ports data handling.
Enables conditional execution on PC-compatible hardware platforms.
Adjusts scheduler priority levels for processes.
Sets disk input/output priority preferences for running applications.
; Changes default printer driver from LPT1 to LPT3 or LPT4 ports as specified.
Restricts execution of DOS applications under certain conditions.
Loads a user interface shell environment during startup.
; Executes conditionally on IBM PS/1-compatible systems only.
; Executes conditionally on IBM PS/2-compatible systems only.
; Suppresses output sent to standard output (STDOUT).

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Inserts comments within CONFIG.SYS files (ignored by PTS-DOS).
Allocates a drive letter to prevent local block device conflicts.
Establishes the default Resume () character for command prompts.
Allows nested CONFIG.SYS processing to return control to the previous GOSUB or SWITCH point, optionally passing back a return code.
Specifies the amount of real mode memory available.
Loads programs declared in CONFIG.SYS simultaneously in the background, similar to CALL or INSTALL commands in DOS.
Saves the initial character of deleted files within the reserved FAT area.
Sets video display modes under FreeDOS or determines screen access methods in PTS-DOS.
Toggles the Scroll Lock key status on the keyboard.
Defines environment variables for system use.
Loads the command interpreter shell.
Functions like SHELL but supports pre-allocating space for relocating COMMAND.COM into HMA or UMBs, enhancing memory efficiency with third-party shells.
Configures keyboard modifier key states such as Shift Lock, Num Lock, and Scroll Lock.
Specifies whether files close automatically when Ctrl+Alt+Del is pressed.
Skips the Power-On Self Test (POST) during reboot sequences.
, STACKSIZE, STACKSHIGH
Specify hardware interrupt stack sizes and buffer locations across various DOS versions to optimize system stability and performance.
, SYSBOOT, SYSGEN, SYSLOAD
Directives unique to PTS-DOS that manage boot manager settings and allocate system memory for loading alternative operating systems.
, SWITCH
Enables conditional nested processing within CONFIG.SYS using labels and return commands, improving script flexibility (available from DOS 6.0 onwards).
, SWAPPATH
OS/2-specific commands that suppress error logging and configure swap file paths to enhance system reliability.
, SWITCHES
Define default command-line switch characters ('/' or '-') and special parsing options across different DOS variants.
, TRACE, TRACEBUF
Control execution timeouts and enable step-by-step debugging for CONFIG.SYS and AUTOEXEC.BAT scripts in DR-DOS, PTS-DOS, and OS/2 environments.
Additional directives such as TMPEXT, TRAPDUMP, THREADS, TIMESLICE optimize handling of temporary files, error logging, thread concurrency, and scheduler time slices to boost overall system performance.

UTemplate:NbndZ

Assigns a specific memory segment as an Upper Memory Block (UMB) for DOS usage.
Configures the UMB server component.
Defines address ranges designated as UMB RAM areas.
Enables or disables verification of disk writes.
Sets the reported DOS version presented to applications.
Controls VGA display status settings.
Specifies the active video mode configuration.
Activates virtual DMA capabilities.
Manages processor Virtual Mode Extensions (VME).
Configures VxD drivers for Windows environments.
Sets Windows system support parameters.
Relocates the Extended BIOS Data Area (XBDA).
Executes commands conditionally on XT-compatible machines.
Enables built-in Year 2000 compliance support features.
Defines the default 'Yes' character used in prompt confirmations.
Tracks driver deletions.

Issues

Although a system can boot without CONFIG.SYS or AUTOEXEC.BAT files present, these are vital for full DOS customization and meeting software dependencies. If these files become damaged or corrupted, troubleshooting is necessary.

When CONFIG.SYS lacks a SHELL directive or is missing/corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to 6.0 will fail to boot without it. MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 or later prompt users to provide a path to a command processor if it is absent or aborted, offering limited shell functionality without requiring a reboot.

Due to incompatibilities between MS-DOS versions from 7.0 onwards and DR-DOS, DR-DOS version 7.02 and higher restrict skipping SHELL directives during skip/trace/step debugging modes. This requires valid shell file input before loading COMMAND.COM and improves recovery from invalid shell arguments.

Under MS-DOS/PC DOS, CONFIG.SYS size is limited to several kilobytes (up to 64 KB in later releases), whereas DR-DOS imposes no fixed limit aside from file system constraints. MS-DOS compiles CONFIG.SYS into a tokenized format loaded into memory for sequential processing. In contrast, DR-DOS interprets each directive line individually, enabling precise control over driver and TSR loading order via DEVICE and INSTALL commands. This approach helps resolve conflicts during loading and supports conditional execution based on hardware detection or user input.

MS-DOS/PC DOS versions from 2.0 through 4.01 restrict the SHELL line length to 31 characters. Later versions extend this limit up to 128 characters, while DR-DOS accepts up to 255 characters. Note that CONFIG.SYS directives do not support long filenames.

Dual Booting DOS and Windows 9x

When Windows 95 is installed over an existing DOS or Windows environment, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS to enable dual boot functionality between Windows 9x and DOS. During a DOS startup, 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 cases where Caldera DR-DOS 7.02 or 7.03 coexists with Windows 95, the CONFIG.SYS and AUTOEXEC.BAT files used by Windows remain intact. Instead, DR-DOS utilizes DCONFIG.SYS and AUTODOS7.BAT as its configuration scripts for booting.

OS/2 / Windows NT

OS/2 depends extensively on CONFIG.SYS to load drivers and set environment variables before initiating its graphical user interface.

Within the Windows NT OS/2 subsystem, the CONFIG.SYS file perceived by OS/2 applications is actually maintained within the system registry rather than as a traditional file.

There are numerous CONFIG.SYS commands for OS/2 that are not officially documented.

CONFIG.SYS continues to play a vital role in 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 CONFIG.SYS directives for Windows 98 / MS-DOS 7.10 (archived)
  • Caldera’s CONFIG.SYS Command Reference (archived) detailing DR-DOS 7 directives
  • FreeDOS CONFIG.SYS directive descriptions
  • PTS-DOS 2000 Pro User Manual featuring CONFIG.SYS directives (archived)
  • German-language unofficial PTS-DOS FAQ (archived) with additional CONFIG.SYS commands