Jump to content

GETKEY (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article GETKEY (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 20252 sources
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983
ProductsOperating system configuration

CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This plain text file comprises setup instructions interpreted by the operating system's DOS BIOS (commonly within IBMBIO.COM or IO.SYS) during the boot sequence. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are responsible for configuring DOS to manage devices, applications, and memory allocation. Once CONFIG.SYS is processed, DOS initiates the command interpreter specified by the SHELL directive; if none is designated, it defaults to COMMAND.COM, which then executes AUTOEXEC.BAT.

Typically, this file contains name=value pairs that define settings or load components such as device drivers and terminate-and-stay-resident programs (TSRs). In DOS systems, 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 East-German manufacturer VEB Robotron.

Certain DOS variants prioritize alternative filenames over CONFIG.SYS:

Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 search for CCONFIG.SYS (derived from "Concurrent") instead of CONFIG.SYS. Some editions of Multiuser DOS employ CCONFIG.INI, while REAL/32 looks for MCONFIG.SYS. These platforms support extended configuration options stored in a binary file called CCONFIG.BIN, which is usually edited using CONFIG.EXE.

From DR DOS 3.31 onward—including PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS versions 7.02 and later—DCONFIG.SYS (short for "DR DOS") supersedes CONFIG.SYS. This was originally implemented alongside disk compression utilities to handle drive letter remapping after loading compression drivers and also enables the use of multiple configuration files in multi-boot environments.

OpenDOS 7.01 and DR-OpenDOS 7.02 look for ODCONFIG.SYS, whereas some DR-DOS 7.02+ releases check for DRCONFIG.SYS. Since DR DOS 6.0, the command SYS /DR:ext allows modification of default file extensions to maintain several concurrent system file groups managed by boot loaders like LOADER included with Multiuser DOS and DR-DOS 7.02/7.03.

The SHELL directive can specify alternate AUTOEXEC.BAT files using /P[:filename.ext], permitting COMMAND.COM to accept extensions other than .BAT in this context—a capability also supported by 4DOS. Starting with DR-DOS 6.0, the CHAIN=filespec directive enables continued processing of another configuration file located anywhere on the boot drive; from version 7.02 forward, it additionally supports jumping to designated labels within that file.

Beginning with DR-DOS 7.03, the SYS /A option was introduced to copy matching CONFIG.SYS and AUTOEXEC.BAT files alongside system files.

FreeDOS provides a comparable mechanism using FDCONFIG.SYS. Similarly, RxDOS versions 7.24 and above use RXCONFIG.SYS, while PTS-DOS employs CONFIG.PTS.

Although both CONFIG.SYS and AUTOEXEC.BAT reside in the root directories of Windows 95 and Windows 98 boot drives due to their DOS heritage, these files are generally empty. Unlike its predecessors, 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 configuration file that specifies resource managers and device drivers 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 in CONFIG.SYS to serve as jump destinations for , , , and commands.
Functions like , but also supports inline comments following other CONFIG.SYS instructions. (MS-DOS/PC DOS ignores inline comments only when not enclosed in double quotes.)
Used at the beginning of inline comments alongside the ; directive.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS does not support optional messages but allows conditional execution via boot menus.) DOS version 6.0 and later offers a similar capability by appending after directives, also implemented in DR DOS.
Forces unconditional execution of the next CONFIG.SYS instruction.

ATemplate:NbndC

Determines whether programs can be aborted on encountering errors.
Configures drives to save file access timestamps within FAT reserved directory entries.
Enables conditional command execution on AT-compatible hardware.
Boot management utility.
Adjusts verbosity level of error messages.
Alters the default serial driver assigned to the AUX: device.
Prevents access to character devices outside the virtual \DEV directory.
Loads core device drivers into memory.
Triggers a brief beep even if audible alerts are disabled.
Defines which operating system to boot next.
Enables or disables extended Ctrl+C handling.
Sets the number of disk buffers allocated.
Similar to BUFFERS but loads buffers into HMA or UMB regions.
, CACHETTL, CACHEFLUSH (Embedded DOS 6-XL)
Control cache block allocation and flushing behavior.
Executes programs within CONFIG.SYS and pauses processing until they return.
(DR-DOS 7.02+)
Sets keyboard Caps Lock state.
, CDDBUFFERS (PTS-DOS)
Configure CD-ROM driver buffer settings.
(DR DOS 5.0+, Embedded DOS)
Continues processing CONFIG.SYS from a new file or label.
, CLS, CODEPAGE, CMOSADDR, COLOR (various OS)
Manage system clock type, screen clearing, OEM codepages, CMOS RAM address, and boot menu colors respectively.
, COM2, COM3, COM4 (DR-DOS 7.02+)
Configure serial port devices including quantity, logical order, I/O addresses, and timeouts.
, COMMENT(S) (various OS)
Define DMA buffers and customize inline comment characters or ignore lines altogether.
(DOS 3.0+, DR DOS 3.31+, OS/2)
Enable and configure internationalization support.
, CPSW (DR-DOS/MS-DOS)
Set cursor position for menus and enable codepage switching support.
, CPU88 series (PTS-DOS), CPU386+ (DR-DOS 7.02+, PTS-DOS), etc.
Execute conditionally based on CPU model or speed.

DTemplate:NbndF

Adjust relocation of drive descriptor tables.
Defines memory segment limit for multi-sector disk data deblocking.
Activates internal debugger support.
Boot management utility.
Loads device drivers into memory.
Loads device drivers into upper memory blocks (equivalent to in DRDOS 5.0).
Configures country and codepage parameters for keyboard, screen, and printer devices.
Sets sizes for cache memory areas.
Specifies floppy disk compatibility mode settings.
Determines display font selection.
Controls loading of DOS into high memory area and/or use of upper memory blocks.
Specifies loading of DOS tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory regions.
Defines alternate search paths for DOS files.
Specifies search paths for data files used by applications or drivers.
Defines physical parameters for disk drives.
Sets parameters for unrecognized or unsupported drives.
Refer to .
Enables error logging with PDUMP.nnn files on specified drives.
Displays a message on screen during boot or processing.
Displays messages that include ANSI escape sequences for formatting.
Determines whether extra verification checks occur when launching programs.
Sets assumed error or return codes for subsequent commands.
Configures A20 gate state upon program start-up.
Terminates CONFIG.SYS processing prematurely except for SWITCHES and SHELL directives under certain conditions.
Defines size of hash table used for faster file opening operations, differing from external MS-DOS/PC DOS FASTOPEN drivers.
Specifies number of cached File Control Blocks (FCBs) allowed simultaneously (shares buffer with FILES under DR-DOS).
Same as FCBS but loads FCBs into upper memory regions.
Boot management utility.
Sets maximum number of files that can be open simultaneously.
Same as FILES but allocates file handles in upper memory blocks.
Includes execution of specified subsections within CONFIG.SYS files (see IGNORE).

GTemplate:NbndI

Waits for a key press or timeout, then assigns the error level to the ASCII value of the key pressed (or 1024 if timed out).
Resumes processing of CONFIG.SYS at a designated label.
Continues nested CONFIG.SYS processing at a specified label, returning afterward to the prior point.
Refer to , , or for additional details.
Consult for further information.
See also .
Additional references include or .
Consult or for more context.
Refer to .
Loads a TSR program into memory after relocating the DOS data segment. Compare with INSTCDEX.
See , , or for related commands.
Additional references include .
See or for further details.
Activates console and command line history buffer with enhanced pattern searching capabilities.
Defines the segment address for High Memory Area (HMA).
Configures energy-saving mode via HLT instruction.
Enables scanning of the boot sector for viruses.
Loads installable file system drivers.
Prevents execution of specified CONFIG.SYS subsections.
Permits programs to operate at ring 2, allowing direct hardware I/O access.
Incorporates directives from another menu block (simulated through GOSUB/RETURN in DR-DOS).
Sets the status of the keyboard Insert mode.
Loads TSR program into memory.
Installs TSR program into upper memory blocks (similar to HIINSTALL in DR DOS 5.0).
Loads TSR after DOS data segment relocation. Compare with INSTCDEX.
Adjusts PIC interrupt priorities to elevate specified IRQ number.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the relocated keyboard buffer's memory address.
Sets the highest accessible drive letter limit.
Functions like LASTDRIVE but loads Current Directory Structure (CDS) into upper memory.
Determines paths for DLL searches.
Handles compatibility settings for legacy applications.
Sets the number of permissible file locks.
Manages boot logo and startup message display through PTS-DOS boot manager.
Specifies count, order, I/O port address, and timeout parameters for LPT1 device.[1]
Configures LPT2 device similarly.[1]
Defines settings for LPT3 device.[1]
Enables and sets parameters for LPT4 device.[1]
Establishes wait duration before increasing process priority.
Configures strategy for memory allocation management.
Sets default DOS memory allocation method.
Defines available menu options.
Specifies menu color schemes (emulatable under DR-DOS).
Sets default menu block (emulatable under DR-DOS).
Defines individual menu blocks (emulatable under DR-DOS).
Enables or disables multitrack operations on disks.
Continues CONFIG.SYS processing in a new file following device driver loading and environment variable %NEWFILE% assignment.[2]

NTemplate:NbndQ

Determines default No () character response in Yes/No/Resume prompts.
Toggles keyboard [[Num Lock|Template:Keypress]] state on or off.
Executes conditionally based on last error code, e.g., .
Displays text and waits for a key press, similar to DR-DOS's and .
Requires user confirmation of errors during CONFIG.SYS processing.
Sets buffer size parameters for LPT ports.
Enables conditional execution on PC-compatible hardware platforms.
Configures scheduler priority settings.
Assigns priority levels for disk I/O related programs.
Changes default internal printer device driver among LPT1, LPT3, or LPT4 options.
Specifies whether DOS applications are permitted to run.
Loads a user interface shell environment.
Enables conditional execution on IBM PS/1-compatible systems.
Allows conditional execution on IBM PS/2-compatible machines.
Suppresses output sent to STDOUT display.

RTemplate:NbndT

Enables automatic reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS.
Reserves drive letters for local block device drivers.
Defines the default character used to resume queries.
Returns nested CONFIG.SYS processing control to the previous GOSUB or SWITCH location, optionally with a return code.
Specifies the size of real mode memory.
Allows simultaneous loading of programs in the background during CONFIG.SYS execution.
Stores the initial character of deleted files in the reserved FAT area.
Sets video mode (for FreeDOS) or screen access methods (for PTS-DOS).
Controls the keyboard Scroll Lock state, turning it on or off.
Establishes environment variables.
Loads the command interpreter shell.
Similar to SHELL but supports pre-allocating space to relocate COMMAND.COM into HMA or UMBs, preventing fragmentation.
Defines keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines file closure behavior when Ctrl+Alt+Del is pressed.
Controls whether POST is bypassed during reboot.
, STACKSIZE, STACKSHIGH
Set stack parameters for hardware interrupts and thread stacks across various DOS versions. Some parameters are ignored in newer releases or specific operating system variants.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
PTS-DOS-specific commands managing boot processes, alternative system loading methods, upper memory block (UMB) allocation, and system file memory placement.
, SUPPRESSPOPUPS, SWAPPATH
Directives for OS/2 and DOS that manage submenu blocks, suppress error pop-ups, and configure swap file locations.
, SWITCHAR, SWITCHES
Control conditional execution and define system switch characters across multiple DOS variants including DR-DOS and FreeDOS.
, THREADS, TIMESLICE
OS/2-exclusive settings addressing floating-point unit (FPU) bug fixes, concurrent thread limits, and scheduler time slice durations.
, TRACE, TRACEBUF
Manage timeouts during CONFIG.SYS processing and enable or disable single-step execution with configurable log buffer sizes on DR-DOS, PTS-DOS, and OS/2 platforms.
, TRAPDUMP
Specifies temporary file extensions for PTS-DOS trap dumps and details error logging on OS/2 systems.

UTemplate:NbndZ

Assigns a specific memory segment to be used as Upper Memory Block (UMB) by DOS management routines.
Selects the UMB server implementation in use.
Defines address ranges designated as UMB RAM areas.
Toggles disk write verification on or off.
Reports a specified DOS version to applications.
Configures VGA display status settings.
Sets the active video mode similarly to FreeDOS's SCREEN directive.
Enables or disables the use of virtual DMA capabilities.
Controls whether the processor’s Virtual Mode Extensions (VME) are disabled.
Configures Virtual Device Driver (VxD) settings for Windows environments.
Enables or disables system support features for Windows integration.
Manages relocation of the Extended BIOS Data Area (XBDA).
Executes conditionally on XT-compatible hardware platforms.
Activates built-in Year 2000 compliance support features.
Sets the default affirmative response character used in prompts.
Configures tracking of file deletions.

Issues

While the system can initiate booting without CONFIG.SYS or AUTOEXEC.BAT present, these configuration files are critical for comprehensive customization and meeting software dependencies. Corruption or absence of either necessitates diagnostic efforts.

In cases where CONFIG.SYS lacks a SHELL directive or is damaged/missing altogether, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to MS-DOS 6.0 will fail to boot without it. From MS-DOS 6.0/PC DOS 6.1 onward and in Novell DOS 7+, if COMMAND.COM is unavailable, users are prompted to specify a command interpreter path—allowing limited shell operation without requiring a reboot.

COMMAND.COM from MS-DOS 7.0 and later is incompatible with DR-DOS systems because DR-DOS does not permit bypassing SHELL directives during skip/trace/step modes. Subsequent updates restored skip functionality enabling recovery from invalid shell arguments. When skipping CONFIG.SYS processing without locating a SHELL directive, users must provide a valid shell path before COMMAND.COM loads.

CONFIG.SYS file size is constrained under MS-DOS/PC DOS—typically limited to a few kilobytes (up to 64 KB in later versions)—whereas DR-DOS imposes no such restriction due to its line-by-line interpretation approach rather than tokenization and sorting. This enables precise control over driver and TSR loading order through DEVICE and INSTALL directives, facilitating conflict resolution and troubleshooting while supporting conditional logic based on hardware detection or error conditions.

In MS-DOS/PC DOS versions 2.0 through 4.01, the SHELL command line length was capped at 31 characters. Later releases extended this limit up to 128 characters, while DR-DOS permits up to 255 characters. CONFIG.SYS directives do not support long filenames.

Dual Booting DOS and Windows 9x

When Windows 95 is installed over a preexisting DOS or Windows environment, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS respectively. This renaming supports dual boot functionality between Windows 9x and DOS by temporarily reverting these files to their original names during a DOS startup. Additionally, backup copies of the Windows 95 configuration files are saved as CONFIG.W40 and AUTOEXEC.W40.

In scenarios where Caldera DR-DOS versions 7.02 or 7.03 coexist with Windows 95, the original CONFIG.SYS and AUTOEXEC.BAT files used by Windows remain intact. Instead, DR-DOS employs its own startup files named DCONFIG.SYS and AUTODOS7.BAT.

OS/2 and Windows NT

OS/2 relies heavily on CONFIG.SYS for loading drivers and setting up the environment prior to launching its graphical user interface. Within the Windows NT OS/2 subsystem, however, CONFIG.SYS configurations are maintained within the system registry rather than as standalone files.

There are numerous undocumented CONFIG.SYS commands specific to OS/2, highlighting its intricate setup requirements.

CONFIG.SYS continues to play a crucial role in OS/2-based operating 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 in Windows 98 / MS-DOS 7.10 (archived)
  • Caldera’s CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
  • Guide to FreeDOS CONFIG.SYS directives
  • PTS-DOS 2000 Pro User Manual covering CONFIG.SYS commands
  • Unofficial German PTS-DOS FAQ (PTS/FAQD) including extra CONFIG.SYS directives
  1. ↑ 1.0 1.1 1.2 1.3 Cite error: Invalid <ref> tag; no text was provided for refs named Paul_1997_OD-A3
  2. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Datalight_2005_ROM-DOS