Jump to content

REM (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article REM (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryOperating systems
Founded1983
ProductsConfiguration file 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 format, holds setup instructions accessible to users, which are interpreted by the operating system's DOS BIOS—commonly found in IBMBIO.COM or IO.SYS—during the startup process. The introduction of CONFIG.SYS dates back to DOS version 2.0.

Usage

The directives within CONFIG.SYS tailor DOS settings for hardware devices, software applications, and memory allocation. Once these commands are executed, DOS initiates the command interpreter specified by the SHELL directive; if none is provided, it defaults to COMMAND.COM, which subsequently runs the AUTOEXEC.BAT script.

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

In DOS environments, CONFIG.SYS is located in the root directory of the bootable drive.

The same filename is also utilized by (DCP), an MS-DOS variant developed by the former East German company VEB Robotron.

Certain DOS variants prioritize alternative configuration filenames over CONFIG.SYS:

- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 employ CCONFIG.SYS rather than CONFIG.SYS. Some Multiuser DOS releases use CCONFIG.INI, while REAL/32 seeks MCONFIG.SYS. These platforms maintain extra configuration parameters within a binary file named CCONFIG.BIN, which is typically edited using CONFIG.EXE.

- Versions such as DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, and DR-DOS 7.02+ give precedence to DCONFIG.SYS, frequently employed alongside disk compression utilities or multi-boot configurations. OpenDOS 7.01 and DR-OpenDOS 7.02 look for ODCONFIG.SYS, whereas some DR-DOS 7.02+ editions also check for DRCONFIG.SYS.

- Starting with DR DOS 6.0, it is possible to alter default system file extensions using SYS /DR:ext, allowing multiple concurrent system files in the root directory that can be selected via boot loaders like LOADER included with Multiuser DOS and DR-DOS 7.x.

- The SHELL command supports specifying alternative AUTOEXEC.BAT files through /P[:filename.ext]. COMMAND.COM accepts extensions beyond ".BAT", a feature also supported by 4DOS. Additionally, the CHAIN=filespec instruction permits continuation of processing from another configuration file, optionally jumping to specific labels in DR-DOS 7.02+.

- From DR-DOS 7.03 onwards, the command SYS /A copies matching CONFIG.SYS and AUTOEXEC.BAT files along with system files.

In other systems, FDCONFIG.SYS is used by FreeDOS, RXCONFIG.SYS by RxDOS version 7.24 and later, and CONFIG.PTS by PTS-DOS.

Both CONFIG.SYS and AUTOEXEC.BAT reside in the root directory of Windows 95 and Windows 98 boot drives but are generally left empty. Windows Me does not process CONFIG.SYS during startup; instead, it loads environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

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

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>

:;*?!

Establishes labels within CONFIG.SYS to serve as jump targets for directives such as , , , and .
Functions similarly to , but additionally supports inline comments following other CONFIG.SYS commands. (In MS-DOS/PC DOS, inline comments enclosed in double-quotes are not ignored.)
Used at the beginning of inline comments, working alongside the ; directive.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS does not support custom messages but allows conditional execution via boot menus using and .) Starting with DOS 6.0, a comparable feature is available by appending after the directive (e.g., ).
Forces execution of the next CONFIG.SYS command without condition.

ATemplate:NbndC

Determines whether programs can be aborted when errors occur.
Sets which drives record file modification timestamps on FAT file systems.
Enables conditional execution on AT-compatible hardware.
Boot management utility.
Adjusts the level of detail for error messages.
Changes the default serial device driver (COM1: through COM4:) used by the AUX device.
Disables character devices located outside the virtual \DEV directory.
Loads a base device driver into memory.
Produces a brief beep sound even if audible alerts are disabled.
Defines the operating system to load next during boot.
Enables or disables extended Ctrl+C detection.
Sets the number of disk buffers allocated.
Explicitly loads buffers into High Memory Area (HMA) or Upper Memory Blocks (UMB).
Maximum quantity of 512-byte cache blocks dynamically allocated.
Maximum duration before unused cache blocks are returned to the system pool.
Maximum interval before dirty cache blocks are flushed to disk storage.
Loads programs specified in CONFIG.SYS and runs them in the foreground, pausing further processing until completion.
Configures whether Caps Lock is enabled on the keyboard.
Specifies the name of the CD-ROM hardware driver.
Defines the number of buffers allocated for CD-ROM access.
Continues processing CONFIG.SYS directives from another file or label.
Sets the system clock type used by the operating system.
Clears the display screen.
Specifies one or more OEM codepages in use.
Defines CMOS RAM address parameters.
Sets color schemes for boot menus.
Defines count, order, input/output addresses, and timeout values for serial COM ports (available from DR-DOS 7.02 onward).
Specifies DMA buffer settings for communication devices.
Redefines characters used to initiate inline comments or causes line skipping (behavior varies by OS version).
Enables and configures international language support (implementation differs across OS variants).
Positions display cursor within configuration menus (introduced in DR-DOS 6.0 and later).
Supports codepage switching (present in MS-DOS 4.x but ignored under DR-DOS 7.02+).

Conditional CPU execution directives in PTS-DOS and DR-DOS allow specifying CPU models (such as 8088, 8086, 286, 386) for targeted directive application.

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Defines memory segment address used for multi-sector disk data deblocking operations.
Activates internal debugger functionality.
Boot manager utility.
Loads a device driver into conventional memory.
Loads a device driver into upper memory area (equivalent to in DRDOS 5.0).
Configures country-specific and codepage information for keyboard, screen, and printer devices.
Sets cache memory size parameters.
Determines floppy disk compatibility mode settings.
Specifies font used for display output.
Controls loading DOS into high memory and/or utilizing upper memory blocks.
Loads DOS system tables such as BUFFERS, FCBS, FILES, LASTDRIVE, and STACKS into upper memory space.
Specifies an alternate directory path for DOS files.
Defines search paths for data files used by DOS utilities.
Sets physical parameters associated with disk drives.
Establishes configuration parameters for unrecognized or unknown drives.
Refer to .
Enables error logging to PDUMP.nnn files on a specified drive.
Outputs a message on screen during processing.
Displays messages incorporating ANSI escape sequences for formatting.
Determines whether additional validation checks occur when launching programs.
Sets an error or return code that will be assumed subsequently after execution of commands.
Controls A20 gate state upon program startup to manage memory addressing limits.
Terminates CONFIG.SYS processing prematurely except for SWITCHES and SHELL directives which continue executing.
Defines hash table size to optimize fast file opening operations (distinct from MS-DOS/PC DOS FASTOPEN driver).
Specifies number of cached File Control Blocks (FCBs) that can be opened simultaneously (shares buffer space with FILES parameter under DR-DOS).
Functions like FCBS but explicitly loads into upper memory area.
Boot management utility function again referenced here.
Sets maximum number of files that can be open at once concurrently.
Similar to FILES directive but allocates file handles explicitly into upper memory area.
Includes execution of specified subsections within CONFIG.SYS files (see IGNORE directive).

GTemplate:NbndI

Waits for a key press or timeout, then sets the error level to the ASCII value of the key or 1024 if timed out.
Resumes processing of CONFIG.SYS at the designated label.
Continues nested CONFIG.SYS processing at a specified label, then returns to the previous point.
Refer to , , or for additional details.
Refer to for further information.
Refer to for more context.
See or for related commands.
See or for related instructions.
Consult for additional guidance.
Loads a TSR program into memory similarly to , but after relocating the DOS data segment.
Refer to , , or for related utilities.
Refer to for further explanation.
See or for comparable functions.
Activates console and command line history buffer with enhanced pattern search capabilities.
Defines the memory address of the High Memory Area (HMA) segment.
Configures the HLT instruction for power-saving mode.
Determines whether boot sector virus scanning is enabled.
Loads installable file system drivers.
Prevents execution of specific CONFIG.SYS subsections.
Grants select programs permission to operate at ring 2, allowing direct hardware access.
Incorporates directives from another menu block (emulatable via GOSUB/RETURN in DR-DOS).
Sets the keyboard’s Insert mode status.
Loads a TSR program into memory.
Loads TSR programs into upper memory area (equivalent to HIINSTALL in DR DOS 5.0).
Loads TSR programs following relocation of the DOS data segment.
Adjusts PIC interrupt priorities to prioritize a specified IRQ line.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the address for the relocated keyboard buffer.
Sets the maximum number of accessible drives.
Functions like LASTDRIVE but also loads Current Directory Structure into upper memory.
Specifies search paths for DLL files.
Configures compatibility settings for legacy applications.
Sets the number of file locks allowed.
Manages boot logo display and startup messages using PTS-DOS boot manager features.
Defines count, order, I/O port address, and timeout parameters for LPT1 device.
Defines count, order, I/O port address, and timeout parameters for LPT2 device.
Defines count, order, I/O port address, and timeout parameters for LPT3 device.
Enables and configures LPT4 device with similar settings.
Sets delay time before process priority elevation occurs.
Configures strategy for memory allocation management.
Specifies default DOS memory allocation policy.
Defines available menu options within CONFIG.SYS.
Sets color schemes for menus (emulatable under DR-DOS).
Indicates default menu block selection (emulatable under DR-DOS).
Defines individual menu blocks (emulatable under DR-DOS).
Enables or disables multitrack disk operation support.
Continues CONFIG.SYS processing by loading a new file after driver installation, setting %NEWFILE% environment variable.

NTemplate:NbndQ

Sets default response character for No () in Yes/No/Resume prompts.
Enables or disables keyboard Num Lock status on startup.
Executes commands conditionally based on previous error code, e.g., .
Displays a message and waits for key press, similar to and in DR-DOS environments.
Requires user confirmation when errors occur during CONFIG.SYS processing.
Configures buffer size settings for LPT ports.
Executes commands conditionally on PC-compatible systems only.
Sets configuration parameters for priority scheduling of processes.
Assigns priority levels specifically for disk I/O programs.
Changes default printer device driver assignment among LPT1 through LPT4 ports.
Determines whether DOS applications are permitted to run in current environment.
Loads a user interface shell program during startup sequence.
Executes commands conditionally on IBM PS/1 compatible machines only.
Executes commands conditionally on IBM PS/2 compatible machines only.
Suppresses output sent to STDOUT.

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS files.
Reserves specific drive letters for local block device drivers.
Sets the default Resume () character displayed in command prompts.
Enables returning from nested CONFIG.SYS processing to the previous GOSUB or SWITCH point, optionally passing a return code.
Specifies the size of real mode memory.
Allows simultaneous loading of programs in CONFIG.SYS in the background, functioning similarly to CALL or INSTALL commands.
Determines whether the first character of deleted files is stored in the FAT reserved area.
Defines video display mode for FreeDOS or screen access methods for PTS-DOS.
Controls the Scroll Lock key status on the keyboard (on or off).
Sets environment variables within the system.
Loads the command interpreter shell.
Functions like SHELL but supports preloading COMMAND.COM into HMA or UMBs to optimize memory usage.
Configures keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Specifies whether files should be closed upon pressing Ctrl+Alt+Del.
Determines whether Power-On Self-Test (POST) is bypassed during reboot.
, STACKSIZE, STACKSHIGH
Define hardware interrupt stack sizes and buffer locations across various DOS versions and derivatives.
, SYSBOOT, SYSGEN, SYSLOAD
Directives unique to PTS-DOS for managing boot processes and system loading configurations.
, SWITCH
Manages submenu blocks and conditional nested processing of CONFIG.SYS primarily under DOS variants excluding DR-DOS and FreeDOS.
, SWAPPATH, THREADS, TIMESLICE
OS/2-specific parameters that handle error logging paths, swap file locations, concurrency settings, and scheduler time slices.
, SWITCHES
Sets system switch characters ("/" or "-") and special options across DOS versions except PTS-DOS for SWITCHES functionality.
, TRAPDUMP
OS/2 Warp fixes addressing FPU bugs and enabling detailed error logging features.
, TRACE, TRACEBUF
Control execution timeouts, enable single-step debugging of CONFIG.SYS/AUTOEXEC.BAT, and configure trace log buffer sizes across DOS variants including DR-DOS, PTS-DOS, FreeDOS, and OS/2.

UTemplate:NbndZ

Assigns a specific memory segment as an Upper Memory Block (UMB) for DOS usage.
Defines the UMB server configuration.
Sets address ranges allocated for UMB RAM segments.
Enables or disables verification of disk writes.
Specifies the DOS version reported to software applications.
Configures VGA display status settings.
Sets current video mode similarly to FreeDOS's SCREEN command functionality.
Activates virtual DMA capabilities.
Enables or disables processor Virtual Mode Extensions (VME).
Configures VxD driver parameters for Windows environments.
Manages overall system support related to Windows operation.
Controls relocation of the Extended BIOS Data Area (XBDA).
Conditional execution settings for XT-compatible machines.
Enables built-in Year 2000 (Y2K) compliance support.
Defines default 'Yes' response character used in prompts.
Configures tracking of file deletions.

Issues

Although the system can start even if CONFIG.SYS is absent or corrupted, this file along with AUTOEXEC.BAT remains critical for tailoring the operating system and fulfilling software dependencies. Any corruption necessitates diagnostic efforts.

If CONFIG.SYS lacks a SHELL directive or is damaged, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to DOS 6.0 will fail to boot without it. MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later prompt users to specify a command interpreter path if COMMAND.COM is missing or aborted. This prompt also provides limited runtime shell replacement capabilities without requiring a reboot.

Due to compatibility issues between MS-DOS 7.0+ COMMAND.COM and DR-DOS, versions of DR-DOS from 7.02 onward prevent bypassing SHELL directives during skip/trace/step modes to avoid conflicts in dual-boot environments. In such cases, users may be asked to designate a valid shell before COMMAND.COM loads when skipping CONFIG.SYS processing.

CONFIG.SYS file size is restricted to a few kilobytes in MS-DOS/PC DOS (up to 64 KB in recent releases), whereas DR-DOS imposes no practical size constraints, allowing more flexible configuration management. MS-DOS processes CONFIG.SYS by tokenizing it for execution order, while DR-DOS interprets it line-by-line. This approach offers precise control over loading order of drivers and TSRs through DEVICE and INSTALL commands. Such flexibility assists in resolving load conflicts and supports conditional execution based on hardware detection or user input.

DR-DOS's INSTALL directive enables execution of non-resident programs within CONFIG.SYS processing flow, facilitating seamless integration of temporary utilities.

Earlier MS-DOS versions limited SHELL line length to 31 characters, later extended up to 128 characters. DR-DOS accepts up to 255 characters for this directive. Notably, CONFIG.SYS commands do not accommodate 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 to enable dual boot functionality between Windows 9x and DOS. While booting into DOS, these files temporarily switch back to CONFIG.SYS and AUTOEXEC.BAT. The original Windows 95 versions are preserved under the names CONFIG.W40 and AUTOEXEC.W40.

In configurations where Caldera DR-DOS 7.02/7.03 coexists with Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT files retain their original names, whereas DR-DOS utilizes DCONFIG.SYS and AUTODOS7.BAT for its startup routines.

OS/2 / Windows NT

OS/2 extensively uses CONFIG.SYS to set up drivers and environment variables before launching its graphical user interface.

Within the OS/2 subsystem of Windows NT, the CONFIG.SYS file accessed by OS/2 applications is actually maintained within the system registry.

There are many CONFIG.SYS commands specific to OS/2 that remain undocumented.

CONFIG.SYS continues to be employed 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 commands (archived)
  • Caldera's CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
  • Details on FreeDOS CONFIG.SYS commands
  • PTS-DOS 2000 Pro User Manual with CONFIG.SYS command descriptions
  • Unofficial German-language PTS-DOS FAQ (archived) including CONFIG.SYS command explanations