Jump to content

COM2 (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article COM2 (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryOperating systems
Founded1983
Headquarters
N/A
ProductsConfiguration directives for DOS and OS/2

CONFIG.SYS serves as the central configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, contains setup instructions accessible to users that the operating system's DOS BIOS evaluates during the startup process. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS configure DOS to support various hardware devices and software applications, including memory management utilities. Once these directives are processed, DOS initiates the command shell specified by the SHELL statement; if none is provided, it defaults to COMMAND.COM, which subsequently runs the AUTOEXEC.BAT script.

Typically, this file consists of name=value pairs that set adjustable parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs) into memory.

In DOS environments, CONFIG.SYS is located in the root directory of the system's boot drive.

Certain DOS variants search for alternate configuration filenames that take priority over CONFIG.SYS:

- Advanced iterations of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI, storing settings in a binary file called CCONFIG.BIN, which is modified through CONFIG.EXE. - From version 3.31 onwards, DR DOS, including PalmDOS 1.0 and Novell DOS 7, prioritize DCONFIG.SYS, often to facilitate multi-boot configurations and disk compression features. - Versions OpenDOS 7.01 and DR-OpenDOS 7.02 also recognize ODCONFIG.SYS or DRCONFIG.SYS. - Starting with DR DOS 6.0, the command SYS /DR:ext allows custom extensions for system files, enabling multiple concurrent configurations within a single root directory, selectable via boot loaders such as LOADER.

Additional capabilities include directives like SHELL /P[:filename.ext], which designates alternate AUTOEXEC files, and CHAIN=filespec[,label], allowing continued processing of other configuration files—even those outside the root directory.

FreeDOS employs FDCONFIG.SYS, while RxDOS and PTS-DOS use RXCONFIG.SYS and CONFIG.PTS, respectively.

In Windows 95 and 98 (which are DOS-based), CONFIG.SYS and AUTOEXEC.BAT remain present but are generally left empty. Windows Me no longer processes CONFIG.SYS, instead loading environment variables directly from the Windows Registry.

In contrast, under FlexOS, CONFIG.SYS is a binary file that specifies resource managers and device drivers loaded during system initialization.

Example

Below is a sample 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>

:;*?!

Marks labels within CONFIG.SYS that serve as jump points for , , , , and commands.
Functions similarly to , also used for inline comments following other commands. (Note: In MS-DOS/PC DOS, inline comments inside double quotes are not ignored.)
Used to begin inline comments alongside the ; directive.
Prompts with a Yes/No question to confirm execution of subsequent commands. (FreeDOS does not support custom messages but allows conditional execution through boot menus.)
Executes the next command without condition.

ATemplate:NbndC

Determines whether programs may be terminated upon encountering errors.
Configures drives to record file access timestamps within FAT file systems.
Enables conditional execution specifically on AT-compatible hardware.
Manages the boot process.
Adjusts the level of detail in error messages.
Alters the default serial device driver used internally for the AUX device.
Prevents character devices from being accessible outside the phantom \DEV directory.
Loads a fundamental device driver into system memory.
Produces an audible beep even when sound notifications are disabled.
Designates which operating system is selected for the next boot cycle.
Enables or disables extended Ctrl+C interrupt checking.
Sets the quantity of disk buffers to allocate.
Functions like BUFFERS but loads buffers into HMA or UMB memory areas.
Defines the maximum count of cache blocks allocated from the system pool.
Specifies the maximum duration unused cache blocks remain before returning to the system pool.
Sets the maximum interval before dirty cache blocks are flushed to disk storage.
Executes programs listed in CONFIG.SYS, running them in the foreground and pausing further processing until completion.
Indicates whether keyboard Caps Lock is enabled or disabled.
Names the CD-ROM hardware driver to be used.
Determines the number of buffers allocated for CD-ROM access.
Continues processing CONFIG.SYS directives from a new file or label as specified.
Defines the type of system clock in use.
Clears the display screen.
Specifies one or more OEM codepages for character encoding.
Indicates CMOS RAM address settings.
Defines color schemes for the boot menu interface.
, COM2, COM3, COM4
Establish count, sequence, I/O addresses, and timeout parameters for serial ports (applicable from DR-DOS 7.02 onwards).
, COMMENT(S), COUNTRY, CPOS, CPSW, CPU and CPU-specific directives regulate various hardware configurations and system parameters across DOS variants and embedded environments, impacting device handling and localization.


DTemplate:NbndF

Controls relocation settings for drive descriptor tables in memory.
Specifies memory segment address utilized for multi-sector disk data deblocking operations.
Activates support for an internal debugger tool.
Manages boot loading procedures.
Loads a specified device driver into memory space.
Loads device drivers into upper memory areas (equivalent to in DRDOS 5.0).
Sets country and codepage configurations for keyboard, screen, and printer devices (KBD, SCR, LPT).
Configures sizes for cache memory allocation.
Defines compatibility mode settings for floppy disk drives.
Selects display font characteristics.
Controls whether DOS is loaded into high memory and/or utilizes upper memory blocks.
Loads DOS internal tables such as BUFFERS, FCBS, FILES, LASTDRIVE, and STACKS into upper memory regions.
Specifies an alternate directory path for DOS-related files.
Sets search paths for locating data files during operation.
Defines physical parameters associated with disk drives.
Provides parameter definitions for drives not recognized by default settings.
Refer to for additional details.
Enables PDUMP.nnn error logging and designates target drive location for logs.
Outputs a message directly to the display screen.
Displays messages incorporating ANSI escape sequences for formatting control.
Adds extra validation checks when launching programs to ensure proper execution conditions.
Defines an assumed error or return code value used during program startup checks.
Specifies A20 gate status when initializing a program environment.
Terminates CONFIG.SYS processing prematurely except for SWITCHES and SHELL directives which continue execution.
Determines hash table size used to accelerate file opening operations, differing from MS-DOS/PC DOS FASTOPEN behavior.
Sets maximum number of cached File Control Blocks (FCBs) that can be opened concurrently (shares buffer space with FILES under DR-DOS).
Functions like FCBS but loads cached FCBs into upper memory locations instead of conventional memory.
Boot manager utility controlling startup options and sequences.
Specifies how many files can be opened simultaneously by the system environment.
Similar to FILES but allocates file handles within upper memory blocks rather than standard areas.
Allows inclusion and execution of specific CONFIG.SYS subsections as designated (see IGNORE directive).

GTemplate:NbndI

Awaits key input (or timeout) and assigns error level to the corresponding ASCII value (or 1024 if timed out).
Resumes CONFIG.SYS execution at a designated label.
Continues nested CONFIG.SYS processing at a specified label, then returns to the previous point.
Refer to , , or for additional details.
Consult for further information.
See for related instructions.
Refer to or as applicable.
Consult or for more details.
See .
Loads a TSR program into memory similarly to , but executes after relocating the DOS data segment.
For more information, see , , or .
Refer to for related commands.
See or for additional context.
Activates console and command line history buffers with advanced pattern search capabilities.
Defines the address of the HMA segment.
Configures power-saving mode using HLT instruction.
Specifies virus scanning settings for the system boot sector.
Loads installable file system drivers.
Prevents execution of selected CONFIG.SYS subsections.
Permits specific applications to operate at ring 2, enabling direct hardware I/O access.
Incorporates directives from another menu block (simulated via GOSUB/RETURN in DR-DOS).
Sets the status of keyboard Insert mode.
Installs TSR utilities into memory.
Loads TSR programs into upper memory area (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSR programs after relocating the DOS data segment.
Adjusts PIC interrupt priorities to prioritize a specified IRQ number.

KTemplate:NbndM

Defines keyboard layout configuration.
Specifies the address of the relocated keyboard buffer.
Sets the maximum number of accessible drives.
Functions like LASTDRIVE but also loads Current Directory Structure into upper memory.
Indicates search paths for DLL files.
Manages compatibility settings for legacy applications.
Determines the number of file locks allowed.
Configures support for boot logos and startup messages using PTS-DOS boot manager.
Specifies count, sequence, I/O address, and timeout parameters for LPT1 device.
Similar settings as LPT1 but applied to LPT2 device.
Same configuration as LPT1 but targeting LPT3 device.
Enables and sets parameters for LPT4 device in a comparable manner.
Establishes wait time before elevating process priority.
Defines strategy for memory allocation management.
Sets default memory allocation approach for DOS operations.
Specifies available menu options.
Determines menu color schemes (emulated under DR-DOS).
Sets the default menu block (emulated under DR-DOS).
Defines multiple menu blocks (emulated under DR-DOS).
Enables operations involving multitrack disks.
Continues CONFIG.SYS processing within a new file after loading a device driver, setting the %NEWFILE% environment variable.

NTemplate:NbndQ

Defines the default No () character used in Yes/No/Resume prompts.
Sets keyboard [[Num Lock|Template:Keypress]] state to on or off at startup.
Executes commands conditionally based on previous error code, such as .
Displays text and pauses until a key is pressed, similar to and commands in DR-DOS environments.
Requires user confirmation upon encountering errors during CONFIG.SYS processing.
Configures buffer sizes for LPT ports.
Enables conditional execution on PC-compatible systems only.
Sets configurations related to priority scheduling policies.
Adjusts priority levels for disk I/O processes.
Changes default printer device driver assignment (e.g., switching from LPT1 to LPT3 or LPT4).
Determines whether DOS programs are permitted to run in the environment.
Loads a user interface shell program.
Enables conditional command execution on IBM PS/1-compatible hardware only.
Enables conditional command execution on IBM PS/2-compatible hardware only.
Suppresses output sent to STDOUT display.

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS (not recognized by PTS-DOS).
Allocates a drive letter for local block device drivers.
Sets the default Resume () character displayed in command prompts.
Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH point, optionally passing a return code.
Defines the amount of real mode memory available.
Allows simultaneous loading of programs in CONFIG.SYS, functioning similarly to CALL or INSTALL commands in DOS.
Determines whether the initial character of deleted files is preserved in the FAT reserved area.
Specifies video modes for FreeDOS or screen access methods for PTS-DOS.
Controls the Scroll Lock key status on the keyboard (enabled or disabled).
Establishes environment variables.
Loads the command interpreter shell.
Similar to SHELL but includes a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMBs, improving memory efficiency with third-party shells.
Sets keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Specifies if files should be closed automatically when Ctrl+Alt+Del is pressed.
Determines whether the Power-On Self Test (POST) is bypassed during reboot.
, STACKSIZE, STACKSHIGH, STACK (various OS versions)
Configure stack sizes for interrupts or threads, with some parameters ignored by later DR-DOS releases.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB (PTS-DOS exclusive)
Manage boot manager configurations, alternative operating system boot files, system memory allocation, and loading DOS components into UMBs.
, SWITCHES (DOS variants)
Define submenu blocks or special options but often lack support or are emulated in DR-DOS and FreeDOS environments.
, SWAPPATH, THREADS, TIMESLICE (OS/2)
Control error logging suppression, specify swap file locations, manage concurrent threads, and adjust scheduler time slices.
, SWITCHES
Enable conditional processing within CONFIG.SYS based on user key presses with RETURN functionality to previous execution points (introduced in DR DOS 6.0 and later).
, TMPEXT
Sets default switch characters ('/' or '-') and temporary file extensions depending on the operating system.
, TRACE
Configures command timeouts within CONFIG.SYS and allows single-step execution tracing (behavior varies across OS versions).
, TRAPDUMP (OS/2)
Defines buffer size for trace logs and enables detailed error information recording.

This segment outlines sophisticated CONFIG.SYS directives implemented across various DOS platforms including DR-DOS, PTS-DOS, OS/2, and FreeDOS. It highlights essential system configuration options that are vital for optimizing startup routines, managing memory resources, controlling devices, and handling errors—key concerns in enterprise IT settings.

UTemplate:NbndZ

Directs DOS to utilize a designated segment as Upper Memory Block (UMB) space.
Specifies which UMB server is employed.
Defines address ranges allocated as UMB RAM areas.
Enables or disables verification of disk writes.
Sets the DOS version number reported to applications.
Controls VGA display operational status.
Indicates the current video mode in use, akin to FreeDOS’s SCREEN setting.
Determines whether virtual DMA capabilities are permitted.
Specifies if processor Virtual Mode Extensions (VME) should be turned off.
Configures VxD drivers used by Windows systems.
Adjusts system support parameters for Windows environments.
Manages relocation settings for the Extended BIOS Data Area (XBDA).
Limits execution conditionally to XT-compatible hardware only.
Enables built-in Year 2000 compliance support features.
Sets the default affirmative response character used in prompts.
Controls tracking behavior for file deletions.

Issues

The system is capable of booting even if CONFIG.SYS is absent or damaged; however, both this file and AUTOEXEC.BAT are crucial for comprehensive operating system customization and meeting software dependencies. When these files become corrupted, troubleshooting is necessary.

If the SHELL directive is missing from CONFIG.SYS, or if the file itself is corrupted or unavailable, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions of DOS prior to 6.0 will not boot without COMMAND.COM present, whereas MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later will prompt the user to specify a command processor path. This recovery prompt also appears if COMMAND.COM terminates unexpectedly or is exited intentionally, enabling a limited ability to replace the runtime shell without rebooting.

COMMAND.COM from MS-DOS 7.0 and newer is not compatible with DR-DOS; nonetheless, it often exists on the C: drive in dual-boot configurations. Starting with DR-DOS 7.02, it is no longer possible to bypass SHELL directives when using skip, trace, or step modes. Consequently, a valid shell file must be provided before loading COMMAND.COM from the root directory if no SHELL directive is specified.

Regarding CONFIG.SYS size constraints, MS-DOS and PC DOS impose a limit up to 64 KB in recent editions, while DR-DOS does not enforce a practical maximum because it processes the file line by line. This approach grants DR-DOS enhanced flexibility in managing the sequence of driver and TSR loading through DEVICE and INSTALL commands, facilitating resolution of loading conflicts and integration of temporary external utilities within the CONFIG.SYS execution flow.

In early MS-DOS releases, the SHELL command line was restricted to 31 characters; later versions extended this limit to 128 characters. DR-DOS further increases this capacity to allow up to 255 characters. It should be noted that CONFIG.SYS directives do not support long filenames.

Dual booting DOS and Windows 9x

When Windows 95 is installed over an existing DOS/Windows environment, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed to CONFIG.DOS and AUTOEXEC.DOS respectively to enable dual-boot functionality. During boot-up into DOS mode, these renamed files are temporarily restored to their original filenames. Additionally, Windows 95 system files are backed up under the names 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 employs alternative startup files named DCONFIG.SYS and AUTODOS7.BAT.

OS/2 / Windows NT

OS/2 makes extensive use of CONFIG.SYS for initial configuration tasks such as loading drivers and setting environment variables prior to launching its graphical user interface.

Within the OS/2 subsystem embedded in Windows NT, CONFIG.SYS configurations are represented as entries in the system registry rather than as physical files.

Numerous CONFIG.SYS directives used by OS/2 lack thorough documentation or remain undocumented altogether.

CONFIG.SYS continues to be utilized in OS/2 derivatives including 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 directives (archived)
  • Caldera’s CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
  • Explanation of FreeDOS CONFIG.SYS commands
  • PTS-DOS 2000 Pro User Manual including CONFIG.SYS directive descriptions
  • German-language unofficial PTS-DOS FAQ (PTS/FAQD) with additional CONFIG.SYS information