Jump to content

COM1 (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article COM1 (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 both DOS and OS/2 operating systems. This particular file is an ASCII text document containing setup instructions accessible to users, which are interpreted by the operating system's DOS BIOS—usually found in IBMBIO.COM or IO.SYS—during the initial boot process. The CONFIG.SYS file was first introduced with DOS version 2.0.

Usage

CONFIG.SYS directives are responsible for configuring DOS settings related to devices, applications, and memory management. Once CONFIG.SYS has been processed, DOS proceeds to load the command interpreter defined in the SHELL statement, defaulting to COMMAND.COM if none is specified, which subsequently executes the AUTOEXEC.BAT script.

The structure of CONFIG.SYS primarily consists of name=value pairs that either set 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.

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

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

Earlier releases of Concurrent DOS from versions 3.2 through 4.1 did not utilize CONFIG.SYS; however, subsequent editions like Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 instead search for CCONFIG.SYS. Some Multiuser DOS iterations employ CCONFIG.INI, while REAL/32 looks for MCONFIG.SYS. These operating systems also support supplemental configuration stored in binary files such as CCONFIG.BIN, which are typically edited using CONFIG.EXE.

In versions of DR DOS starting from 3.31, including derivatives like PalmDOS 1.0 and Novell DOS 7, the file DCONFIG.SYS overrides CONFIG.SYS during startup. This functionality facilitates disk compression schemes and multi-boot setups by allowing multiple configuration files to coexist. Additionally, OpenDOS versions 7.01 and DR-OpenDOS 7.02 look for ODCONFIG.SYS, while some DR-DOS 7.02 and later builds check for DRCONFIG.SYS.

Beginning with DR DOS 6.0, the command SYS /DR:ext enables customization of the default configuration file extension, supporting multiple concurrent sets of system files selectable through boot loaders such as LOADER from Multiuser DOS and DR-DOS 7.x. The SHELL directive can specify alternative AUTOEXEC.BAT files using /P[:filename.ext], accommodating extensions beyond .BAT (a feature also supported by 4DOS). Furthermore, the CHAIN=filespec command allows DR-DOS to continue reading from another configuration file, optionally jumping to a specific label with CHAIN=filespec,label in versions 7.02 and above.

Starting with DR-DOS 7.03, the SYS /A option facilitates copying of CONFIG.SYS and AUTOEXEC.BAT alongside other system files.

Other operating systems use similar alternate filenames: FDCONFIG.SYS for FreeDOS, RXCONFIG.SYS for RxDOS version 7.24 and later, and CONFIG.PTS in PTS-DOS.

Within Windows 95 and Windows 98 environments, both CONFIG.SYS and AUTOEXEC.BAT exist in the root directory of boot drives but are generally left empty. In contrast, Windows Me does not process CONFIG.SYS during startup; instead, environment variables are loaded directly from the registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

For the FlexOS operating system, CONFIG.SYS is a binary file that specifies resource managers and device drivers to be loaded during system initialization.

Example

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 used as jump targets for , , , , and commands.
Functions like , also employed for inline comments following other directives. (Note: MS-DOS/PC DOS does not ignore inline comments enclosed in double quotes.)
Introduces inline comments, similar to the ; directive.
Prompts a Yes/No confirmation before executing subsequent directives. (FreeDOS supports conditional execution with boot menus but lacks customizable messages.)
Executes the next directive unconditionally.

ATemplate:NbndC

Determines whether programs can be interrupted upon errors.
Sets which drives record file access timestamps in FAT file systems.
Executes conditionally on AT-compatible hardware.
Provides boot management functionality.
Adjusts verbosity level of error messages.
Alters the default serial driver assigned to the AUX device.
Prevents character devices from being accessible outside the phantom \DEV directory.
Loads a base device driver into memory.
Produces a brief beep sound even if audible alerts are disabled.
Defines the next operating system to boot.
Enables or disables extended Ctrl+C checking.
Specifies how many disk buffers to allocate.
Similar to BUFFERS but loads buffers into HMA or UMB areas.
, ,
Control cache block allocation parameters, lifespan, and flushing intervals.
Loads programs during CONFIG.SYS processing and pauses until they return control.
Sets the keyboard Caps Lock state.
,
Configures CD-ROM driver name and buffer quantity.
Continues processing CONFIG.SYS from another file or label.
, , and other display-related commands manage system clock type and screen clearing (specific to DR DOS versions).
, , and related directives enable support for internationalization and OEM codepages (mainly in OS/2 and DOS variants).
, ...,
Define serial COM port count, order, I/O addresses, and timeouts.
, also called COMMENTS, reassign inline comment characters or cause lines to be ignored depending on DOS version.

Additional CPU-specific conditional directives such as CPU88, CPU286, CPU386 enable command targeting based on processor type and features (supported by PTS-DOS and DR-DOS).

DTemplate:NbndF

Adjusts relocation of drive descriptor tables.
Sets memory segment address for multi-sector disk data deblocking operations.
Activates internal debugger support.
Manages boot operations.
Loads a device driver into memory.
Loads device drivers into upper memory area (equivalent to in DRDOS 5.0).
Configures country and codepage settings for keyboard, screen, and printer devices.
Adjusts cache memory sizes.
Sets compatibility mode for floppy disks.
Specifies the display font to use.
Controls whether DOS loads into high or upper memory areas.
Loads DOS tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory.
Defines an alternative search path for DOS files.
.
Specifies path locations for data files.
Sets parameters for physical disk drives.
Defines settings for unknown drives.
See .
Enables error logging with PDUMP.nnn files on specified drives.
Outputs a message on the screen.
Displays messages including ANSI escape codes.
Adds extra checks when launching programs.
Assigns an assumed error or return code for subsequent commands.
Controls A20 gate state during program startup.
Terminates CONFIG.SYS processing early except for SWITCHES and SHELL directives under certain conditions.
Configures hash table size used for accelerating file open operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
Sets number of cached File Control Blocks (FCBs) allowed open simultaneously (sharing buffer space with FILES under DR-DOS).
Similar to FCBS but loads buffers into upper memory area.
Boot management command.
Specifies maximum number of files that can be open concurrently.
Like FILES but loads file handles into upper memory area.
Includes execution of designated CONFIG.SYS subsections (refer to IGNORE).

GTemplate:NbndI

Waits for a keypress or until a timeout occurs, assigning the error level to the ASCII value or 1024 if timed out.
Resumes processing of CONFIG.SYS at a designated label.
Continues nested CONFIG.SYS processing at a specified label, then returns to the previous position.
Refer to , , or for additional details.
See also .
Consult .
Refer to or for more information.
See or for usage.
Consult .
Loads a terminate-and-stay-resident (TSR) program into memory post-DOS data segment relocation; compare with INSTCDEX.
See , , or for related commands.
Consult .
Refer to or for further explanation.
Activates console and command line history buffer with advanced pattern search capabilities.
Designates the address of the High Memory Area (HMA) segment.
Sets up HLT power-saving mode.
Enables scanning for boot sector viruses.
Loads installable file system drivers.
Prevents execution of certain CONFIG.SYS subsections (also see: ).
Permits specific applications to operate at ring 2, allowing direct hardware input/output access.
Incorporates directives from another menu block, emulated through GOSUB/RETURN in DR-DOS.
Sets the status of the keyboard Insert mode.
Installs TSR programs into conventional memory.
Loads TSR programs into upper memory, similar to HIINSTALL in DR DOS 5.0.
Installs TSR software after relocating the DOS data segment (see also INSTCDEX).
Rotates Programmable Interrupt Controller (PIC) priorities to give precedence to a specified IRQ number.

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 loads the Current Directory Structure into upper memory.
Lists paths for DLL searches.
Manages compatibility with legacy applications.
Determines the number of file locks allowed.
Configures display settings for boot logos using the PTS-DOS boot manager.
Defines count, logical sequence, I/O port address, and timeout period for the LPT1 device.
Applies identical settings as LPT1 for LPT2 device configuration.
Mirrors LPT1 settings for LPT3 device configuration.
Enables and sets parameters for LPT4 device similarly to other LPT devices.
Specifies delay before elevating process priority.
Configures memory allocation method preferences.
Sets default DOS memory allocation behavior.
Defines options available in menus.
Specifies menu color schemes, which can be emulated using ECHO commands in DR-DOS.
Sets the default menu block, emulatable via TIMEOUT and SWITCH commands in DR-DOS environments.
Defines multiple menu blocks, emulatable through ECHO and SWITCH commands in DR-DOS systems.
Enables operations involving multitrack disks.
Continues processing CONFIG.SYS from another file, optionally after loading a device driver and setting %NEWFILE%.

NTemplate:NbndQ

Determines the default character representing 'No' () in Yes/No/Resume prompts.
Sets the status of the keyboard's [[Num Lock|Template:Keypress]] key at startup.
Allows conditional execution based on the last error code encountered, such as .
Displays a message and waits for a keypress, functioning similarly to and in DR-DOS systems.
Requires user confirmation upon encountering errors during CONFIG.SYS processing.
Configures buffer sizes for parallel ports LPT1 through LPT3.
Enables conditional execution on PC-compatible hardware platforms.
Adjusts scheduler priority settings.
Sets priority levels specifically for disk I/O processes.
Changes the default printer device driver assignment among LPT1, LPT2, LPT3, or LPT4 ports.
Specifies whether DOS applications are permitted to run under certain conditions.
Loads a user interface shell environment during startup.
Enables conditional execution tailored for IBM PS/1-compatible machines.
Allows conditional execution tailored for IBM PS/2-compatible machines.
Suppresses output directed to STDOUT.

RTemplate:NbndT

Activates automatic reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS (ignored in PTS-DOS).
Allocates a drive letter for local block device drivers.
Sets the default character used to resume () during queries.
Returns processing control from nested CONFIG.SYS back to the previous GOSUB or SWITCH location, optionally with a return code.
Specifies the size of real mode memory.
Executes programs in CONFIG.SYS simultaneously in the background, similar to CALL or INSTALL commands.
Stores the initial character of deleted files within the FAT reserved area.
Defines video mode under FreeDOS or screen access method under PTS-DOS.
Controls the Scroll Lock key status on the keyboard.
Establishes environment variables.
Loads the command interpreter shell.
Functions like SHELL but supports a SIZE parameter to pre-allocate COMMAND.COM into HMA or UMBs, optimizing memory usage with third-party shells.
Defines keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines whether files close upon pressing Ctrl+Alt+Del.
Skips POST during system reboot.
, STACKSIZE, STACKSHIGH
Configure hardware interrupt stack sizes across different DOS versions to optimize memory allocation for system processes.
, SYSBOOT, SYSGEN, SYSLOAD
PTS-DOS directives controlling boot options, memory layout, and alternative system loading for enhanced startup flexibility.
, SWITCH
Defines submenu blocks and enables conditional nested CONFIG.SYS processing for advanced configuration (DOS 6 and later).
, SWAPPATH
OS/2 commands that suppress error logging and specify swap file locations to improve system stability.
, SWITCHES
Set default command-line switch characters ('/' or '-') and special options for various DOS versions to improve command parsing consistency.
, THREADS, TIMESLICE
OS/2-specific parameters that address hardware floating-point unit fixes, define concurrent thread counts, and adjust scheduler time slices for performance enhancement.
, TRACE, TRACEBUF
Control CONFIG.SYS execution timeouts and enable detailed step-by-step logs for debugging in DR-DOS, PTS-DOS, and OS/2 systems.
, TRAPDUMP
Sets temporary file extensions (PTS-DOS) and enables detailed error logging (OS/2), aiding system maintenance.

UTemplate:NbndZ

Assigns a specific segment for use as UMB memory by DOS.
Configures the Upper Memory Block server.
Defines address ranges allocated for UMB RAM.
Enables or disables disk write verification processes.
Specifies the DOS version reported to applications.
Manages VGA display status settings.
Sets the current video mode configuration.
Determines whether virtual DMA is permitted.
Enables or disables processor Virtual Mode Extensions.
Configures VxD driver parameters for Windows environments.
Sets Windows system support options.
Adjusts relocation of the Extended BIOS Data Area.
Executes commands conditionally on XT-compatible machines.
Configures built-in Year 2000 compliance support.
Defines the default character used for affirmative prompts.
Controls tracking of file deletions.

Issues

Although booting without CONFIG.SYS or AUTOEXEC.BAT is possible, these files are vital for comprehensive operating system customization and satisfying software prerequisites. Any corruption or damage necessitates troubleshooting.

If 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 fail if it is not found, whereas MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later prompt users to specify a command processor path. This prompt also appears if the main shell terminates unexpectedly or exits intentionally, allowing limited shell replacement at runtime without rebooting.

COMMAND.COM from MS-DOS 7.0 onward is incompatible with DR-DOS but frequently resides in the root of drive C: in dual-boot configurations. Starting with DR-DOS 7.02, bypassing SHELL directives during skip, trace, or step modes is no longer permitted. Users must specify a valid shell before loading COMMAND.COM if none is detected.

CONFIG.SYS file size limitations differ by operating system: MS-DOS and PC DOS restrict files to several kilobytes (up to 64 KB in later versions), whereas DR-DOS imposes no practical limit by interpreting directives line-by-line instead of tokenizing them. This approach grants DR-DOS users enhanced flexibility over driver and TSR loading order through DEVICE and INSTALL, facilitating conflict resolution and integration of debuggers or temporary utilities directly within CONFIG.SYS.

Earlier MS-DOS releases limited the length of the SHELL line to 31 characters, later expanded to 128 characters. DR-DOS supports up to 255 characters. Notably, CONFIG.SYS directives do not accept long filenames.

Dual Booting DOS and Windows 9x

When Windows 95 is installed on top of an existing DOS/Windows environment, the files CONFIG.SYS and AUTOEXEC.BAT are renamed to CONFIG.DOS and AUTOEXEC.DOS to enable dual boot functionality between Windows 9x and DOS. During a DOS boot, these renamed files are temporarily switched back to their original names, CONFIG.SYS and AUTOEXEC.BAT. Additionally, Windows 95 versions of these files are saved as CONFIG.W40 and AUTOEXEC.W40.

In cases where Caldera DR-DOS 7.02/7.03 is installed alongside Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT filenames remain unchanged, whereas DR-DOS uses DCONFIG.SYS and AUTODOS7.BAT for its startup configuration.

OS/2 and Windows NT

OS/2 depends extensively on CONFIG.SYS to set up drivers and environment variables prior to launching its graphical user interface.

Within the OS/2 subsystem found in Windows NT, the CONFIG.SYS configurations are presented to OS/2 applications but are actually maintained within the system registry.

There exist several undocumented CONFIG.SYS commands specific to OS/2.

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
  • FreeDOS CONFIG.SYS directives description
  • PTS-DOS 2000 Pro User Manual featuring CONFIG.SYS directives (archived)
  • Unofficial German PTS-DOS FAQ (2004) including CONFIG.SYS directives (archived)