Jump to content

LOCKS (CONFIG.SYS directive)

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

CONFIG.SYS serves as the essential configuration file for DOS and OS/2 operating systems. This plain text file contains configuration commands that the operating system's DOS BIOS—usually found in IBMBIO.COM or IO.SYS—interprets during startup. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

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

Primarily, this file includes name=value commands that adjust system parameters 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 bootable drive.

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

Certain DOS versions support alternative configuration filenames that supersede CONFIG.SYS:

- Advanced releases of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 employ CCONFIG.SYS or CCONFIG.INI instead, with supplementary settings stored in a binary file named CCONFIG.BIN, commonly managed through CONFIG.EXE. - In DR DOS 3.31 and later versions including PalmDOS, Novell DOS, and OpenDOS, DCONFIG.SYS takes priority over CONFIG.SYS to facilitate disk compression and multi-boot configurations. - OpenDOS 7.01 and DR-OpenDOS 7.02 also recognize configuration files named ODCONFIG.SYS or DRCONFIG.SYS. - From DR DOS 6.0 onward, users can modify the default configuration file extensions using the SYS /DR:ext command, allowing multiple system file sets to coexist and be selected via boot loaders such as LOADER. - The SHELL directive allows specifying alternative AUTOEXEC.BAT files using /P[:filename.ext], supported by COMMAND.COM and enhanced shells like 4DOS. - DR-DOS introduces the CHAIN=filespec command to continue processing another configuration file, optionally with a label parameter (CHAIN=filespec,label) to jump to specific sections. - Starting with DR-DOS 7.03, the SYS /A command copies CONFIG.SYS and AUTOEXEC.BAT alongside other system files.

In other systems, FreeDOS uses FDCONFIG.SYS, while RxDOS relies on RXCONFIG.SYS. The distribution PTS-DOS utilizes CONFIG.PTS.

For Windows 95 and 98 (which are DOS-based), CONFIG.SYS and AUTOEXEC.BAT remain present in the root directory but are generally left empty. Windows Me does not process CONFIG.SYS at all; instead, it retrieves environment variables from the registry (HKLM\System\CurrentControlSet\Control\SessionManager\Environment).

Under the FlexOS operating system, CONFIG.SYS exists as a binary file responsible for defining resource managers and device drivers.

Example

A sample CONFIG.SYS 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 inside CONFIG.SYS that serve as jump targets for , , , , and commands.
Functions similarly to , also used to add inline comments following other directives within CONFIG.SYS. (In MS-DOS/PC DOS, inline comments are not ignored if enclosed in double quotes.)
Used at the start of inline comments alongside ;.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS does not support custom messages but allows conditional execution with boot menus defined via and .) Starting with DOS 6.0, this feature can be achieved by appending after directives; this is also supported by DR DOS.
Forces unconditional execution of the next CONFIG.SYS directive.

ATemplate:NbndC

Determines whether programs can be interrupted upon encountering errors.
Sets which drives record file access timestamps within FAT file systems.
Enables conditional command execution on AT-compatible hardware.
Manages boot operations.
Adjusts the level of detail for error message output.
Alters the default serial driver assigned to the AUX device.
Prevents character devices from being accessible outside the phantom \DEV directory.
Loads the fundamental device driver into system memory.
Produces an audible beep even when alert notifications are turned off.
Defines the operating system to launch next during boot.
Enables or disables extended Ctrl+C signal monitoring.
Specifies how many disk buffers should be allocated.
Explicitly loads buffers into HMA or UMB areas.
Sets the maximum number of cache blocks dynamically assigned.
Defines the maximum duration before unused cache blocks are returned to the system pool.
Sets the maximum time before dirty cache blocks are written back to disk.
Loads programs listed in CONFIG.SYS and pauses processing until they return control.
Controls the initial Caps Lock state of the keyboard.
Indicates the name of the CD-ROM hardware driver in use.
Determines the number of buffers dedicated to CD-ROM access.
Continues CONFIG.SYS execution from a new file or label reference.
Specifies the type of system clock implemented.
Clears the display screen.
Defines OEM codepage(s) for character encoding.
Provides the memory address of CMOS RAM.
Configures color settings for the boot menu interface.
, ;, ;, ;

Sets count, logical sequence, I/O port address, and timeout values for COM ports (applicable in DR-DOS 7.02 and later).

Allocates buffer space for DMA operations (specific to PTS-DOS).

Modifies lead-in characters used for inline comments or causes subsequent lines to be ignored (behavior varies by operating system).

Activates and configures internationalization features (dependent on OS).

Positions display cursor within configuration menus (available in DR DOS 6.0 and newer).

Supports codepage switching functionality (present in MS-DOS versions 4.00 through 4.01). Conditional directives such as CPU386 specify processor type requirements for commands (implementation varies by OS).

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Sets memory segment limits relevant to multi-sector disk data deblocking processes.
Activates internal debugger capabilities.
Handles boot management tasks.
Loads device drivers into conventional memory space.
Loads device drivers into upper memory blocks (equivalent to directive in DRDOS 5.0).
Configures country-specific and codepage settings for keyboard, screen, and printer devices.
Specifies sizes for cache memory allocation.
Defines floppy disk compatibility modes.
Selects display font settings.
Controls whether DOS loads into high memory and/or utilizes upper memory areas.
Loads DOS internal tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory regions.
Specifies an alternative search path for DOS system files.
Defines search paths for data files used by DOS applications.
Sets physical parameters for disk drives recognized by the system.
Establishes parameters applicable to unidentified or unsupported drives.
Refer to for additional details.
Enables error logging with PDUMP.nnn files and specifies target drive location.
Displays a textual message on screen output devices.
Outputs messages that include ANSI escape sequences for enhanced formatting.
Implements extra validation checks when launching programs to ensure stability.
Defines an assumed error or return code for following commands during processing.
Controls A20 line gate state upon program startup to manage memory addressing modes.
Terminates CONFIG.SYS processing prematurely except for SWITCHES and SHELL directives which continue execution.
Sets size of hash table used to accelerate file opening operations, differing from MS-DOS FASTOPEN driver behavior.
Determines number of cached File Control Blocks that can remain open simultaneously (shares buffer with FILES under DR-DOS).
Functions like FCBS but loads these controls into upper memory instead of conventional memory space.
Manages boot-related operations similar to other boot manager functions.
Specifies maximum number of files that may be opened at once by DOS processes.
Equivalent to FILES directive but loads file handles into upper memory segments rather than conventional memory.
Executes specified subsections within CONFIG.SYS files as part of configuration processing (see IGNORE directive).

GTemplate:NbndI

Waits for a key press or timeout, setting the error level to the ASCII value or 1024 if timed out.
Resumes processing of CONFIG.SYS at the specified label.
Continues nested CONFIG.SYS processing from the given label and returns to the prior location afterward.
Refer to , , or for additional details.
See also .
Consult .
Refer to or for further information.
See or as applicable.
Consult .
Loads a TSR program after relocating the DOS data segment; compare with INSTCDEX.
See , , or for related commands.
Consult .
Refer to or for additional context.
Activates console and command line history with enhanced pattern search capabilities.
Defines the address of the HMA segment.
Configures energy-saving settings via the HLT instruction.
Enables scanning for boot sector viruses.
Loads installable file system drivers.
Prevents execution of certain CONFIG.SYS subsections; see also .
Permits designated programs to operate at ring 2 for direct hardware input/output access.
Includes directives from another menu block, emulatable through GOSUB/RETURN in DR-DOS.
Sets the keyboard Insert mode status.
Installs a TSR program into memory.
Installs a TSR into upper memory, equivalent to HIINSTALL in DR DOS 5.0.
Installs TSR after relocating the DOS data segment; compare with INSTCDEX.
Adjusts PIC interrupt priorities by assigning highest priority to a specified IRQ number.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the relocated address of the keyboard buffer.
Sets the maximum number of accessible drives.
Similar to LASTDRIVE but loads Current Directory Structure into upper memory.
Lists paths for DLL searches.
Manages backward compatibility for legacy applications.
Configures the number of file locks allowed.
Controls boot logo display using PTS-DOS boot manager.
Specifies count, order, I/O address, and timeout parameters for LPT1 device.
Applies same settings as LPT1 for LPT2 device.
Mirrors LPT1 configuration for LPT3 device.
Enables and configures LPT4 device similarly to others.
Sets delay before waiting processes receive higher priority scheduling.
Determines memory allocation strategies used by DOS.
Defines default DOS memory allocation approach.
Specifies menu options within CONFIG.SYS.
Sets menu color schemes, which can be emulated under DR-DOS environments.
Defines default menu block, emulatable in DR-DOS systems.
Creates a menu block structure, compatible with DR-DOS emulation.
Enables multitrack disk access operations.
Continues CONFIG.SYS processing within a new file, optionally loading a device driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Sets default "No" character used in Yes/No/Resume prompts (No () character).
Turns keyboard [[Num Lock|Template:Keypress]] on or off by default.
Enables conditional execution based on the last error code, such as .
Displays text and pauses until a key is pressed, similar to DR-DOS's and commands.
Requires user confirmation upon encountering errors in CONFIG.SYS processing.
Configures buffer sizes for parallel ports LPT1 through LPT3 devices.
Allows conditional execution on PC-compatible systems only.
Sets process scheduler priority levels for running programs.
Assigns disk I/O priority to specific applications for improved performance.
Switches default printer device driver among LPT1 through LPT4 options.
Restricts execution of DOS programs under certain conditions.
Loads a user interface shell environment during booting process.
Enables conditional execution on IBM PS/1-compatible machines exclusively.
Enables conditional execution on IBM PS/2-compatible machines exclusively.
Suppresses output sent to STDOUT display.

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS files.
Allocates drive letters for local block device drivers.
Defines the default character used in Yes/No/Resume prompts.
Returns nested CONFIG.SYS processing control to the previous GOSUB or SWITCH statement, optionally passing a return code.
Specifies the size of real mode memory available.
Executes programs in CONFIG.SYS simultaneously in the background, similar to CALL or INSTALL commands found in DOS/OS2 environments.
Saves the first character of deleted files within the FAT reserved area.
Determines video mode settings (FreeDOS) or screen access methods (PTS-DOS).
Controls the state of the keyboard Scroll Lock key, turning it on or off.
Assigns environment variables.
Loads the command interpreter shell.
Functions like SHELL but allows pre-allocated memory size for relocating COMMAND.COM into HMA or UMBs to minimize fragmentation.
Sets keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Configures whether files close automatically upon pressing Ctrl+Alt+Del.
Skips the Power-On Self-Test (POST) during reboot sequences.
, STACKSIZE, STACKSHIGH
Define stack sizes for hardware interrupts and thread stacks across multiple DOS versions and OS/2 platforms, with notes on compatibility nuances.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
PTS-DOS-specific commands managing boot processes, alternative system loading methods, and memory placement within upper memory blocks (UMBs).
, SUPPRESSPOPUPS, SWAPPATH, SWITCH
Various directives controlling submenu blocks, suppression of error popups, swap file directory paths, and conditional flow control in CONFIG.SYS with support for RETURN statements.
, SWITCHES
Specify system switch characters ('/' or '-') and special option flags across different DOS variants, highlighting exceptions where applicable.
, THREADS, TIMESLICE
OS/2 directives addressing FPU bug fixes, setting concurrent thread counts, and adjusting scheduler time slice intervals.
, TMPEXT
Configures timeout durations for CONFIG.SYS commands and sets temporary file extensions within DR-DOS and PTS-DOS environments.
, TRACEBUF
Enables or disables single-step execution tracing of CONFIG.SYS globally or locally and configures log buffer sizes in OS/2 and various DOS systems.
An OS/2 directive that logs comprehensive error details for diagnostic use.

UTemplate:NbndZ

Assigns a specific segment to function as an Upper Memory Block (UMB) in DOS.
Designates the UMB server component.
Defines address ranges utilized as UMB RAM areas.
Toggles disk write verification on or off.
Sets the DOS version number reported to applications.
Configures VGA display status parameters.
Specifies the current video mode, analogous to FreeDOS's SCREEN command.
Enables use of virtual DMA capabilities.
Controls processor Virtual Mode Extensions (VME) settings.
Configures VxD driver parameters for Windows environments.
Sets system-level Windows support options.
Relocates the Extended BIOS Data Area (XBDA).
Enables conditional execution on XT-compatible machines only.
Configures built-in Year 2000 compliance features.
Sets the default affirmative character used in prompts.
Manages deletion tracking functionality.

Issues

Although the system is capable of booting without CONFIG.SYS or AUTOEXEC.BAT files, these configuration files remain critical for comprehensive operating system customization and meeting software prerequisites. When these files become damaged or corrupted, troubleshooting is required.

If CONFIG.SYS does not contain a SHELL directive or if it is missing or corrupted, DOS attempts to locate COMMAND.COM within the root directory of the boot drive. Versions prior to 6.0 will fail to boot if COMMAND.COM is absent. In contrast, MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later will prompt users to specify a path to a command interpreter. This prompt also appears if the command processor terminates unexpectedly or exits deliberately, allowing limited shell replacement during runtime without needing a reboot.

Because MS-DOS versions from 7.0 onward have compatibility issues with DR-DOS's COMMAND.COM implementation, DR-DOS 7.02 and later restrict bypassing SHELL directives when operating in skip, trace, or step modes. This measure enhances stability during boot recovery by requiring users to input a valid shell filename before loading COMMAND.COM from the root directory.

CONFIG.SYS file size limitations differ among systems: MS-DOS and PC DOS impose limits of several kilobytes (up to approximately 64 KB in newer releases), whereas DR-DOS imposes no practical size restrictions. DR-DOS interprets CONFIG.SYS line-by-line and offers flexible management of driver and TSR load order via DEVICE and INSTALL commands. This flexibility facilitates conflict resolution and debugging by enabling precise control over load sequences and integration of temporary external utilities during startup.

Earlier MS-DOS editions restricted SHELL command lines to a maximum length of 31 characters. Later versions expanded this limit up to 128 characters, while DR-DOS supports up to 255 characters. It is important to note that CONFIG.SYS directives do not accept long filenames.

Dual Booting with DOS and Windows 9x

When Windows 95 is installed over a pre-existing DOS or Windows environment, the original CONFIG.SYS and AUTOEXEC.BAT files 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 temporarily assume the CONFIG.SYS and AUTOEXEC.BAT filenames. Meanwhile, backup copies of 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 is installed alongside Windows 95, the system does not alter Windows' CONFIG.SYS and AUTOEXEC.BAT files. Instead, DR-DOS utilizes its own startup configuration files named DCONFIG.SYS and AUTODOS7.BAT.

OS/2 and Windows NT

The OS/2 operating system depends extensively on CONFIG.SYS to set up device drivers and environment variables prior to loading its graphical user interface.

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

Numerous CONFIG.SYS commands used by OS/2 are either undocumented or only partially described.

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) – summary of DR-DOS 7 directives
  • FreeDOS CONFIG.SYS directive descriptions
  • User manual for PTS-DOS 2000 Pro including CONFIG.SYS directives overview
  • Unofficial German PTS-DOS FAQ (2004) featuring additional CONFIG.SYS directives