Jump to content

SHIFTSTATE (CONFIG.SYS directive)

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

CONFIG.SYS serves as the fundamental configuration file for the DOS and OS/2 operating systems. This plain text ASCII file holds configuration commands that the system's DOS BIOS—commonly located in IBMBIO.COM or IO.SYS—executes during the boot 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 CONFIG.SYS is processed, DOS launches the command interpreter specified by the SHELL directive; if none is provided, it defaults to COMMAND.COM, which then executes the AUTOEXEC.BAT script.

Primarily, CONFIG.SYS contains name=value pairs that configure system parameters or load device drivers and terminate-and-stay-resident (TSR) programs. This file is located in the root directory of the active boot drive.

The same filename is used by (DCP), an MS-DOS variant developed by East-German manufacturer VEB Robotron.

Certain DOS derivatives recognize alternative filenames that supersede CONFIG.SYS:

Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 adopt CCONFIG.SYS (derived from "Concurrent") instead of CONFIG.SYS. Some versions of Multiuser DOS utilize CCONFIG.INI, while REAL/32 looks for MCONFIG.SYS. These platforms also support extended configuration data stored in binary files such as CCONFIG.BIN, which are generally modified using CONFIG.EXE.

In DR DOS 3.31 and subsequent releases including PalmDOS, Novell DOS, and DR-DOS 7.x, DCONFIG.SYS (where "D" signifies DR DOS) takes precedence over CONFIG.SYS. Initially associated with disk compression utilities that enable drive letter reassignment, this file also supports multi-boot setups.

OpenDOS versions 7.01 and DR-OpenDOS 7.02 search for ODCONFIG.SYS, while some DR-DOS 7.02+ editions look for DRCONFIG.SYS. Since DR DOS 6.0, the SYS /DR:ext command allows renaming system and configuration files to facilitate multiple concurrent configurations within a single root directory. These can be selected through boot managers like LOADER, included with Multiuser DOS and DR-DOS 7.x. The SHELL command supports alternative AUTOEXEC.BAT files via /P[:filename.ext], a feature compatible with both COMMAND.COM and 4DOS. Additionally, the CHAIN=filespec directive enables continuation of processing in another configuration file, optionally specifying labels (CHAIN=filespec,label).

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

FreeDOS employs a comparable file named FDCONFIG.SYS; RxDOS version 7.24 and later uses RXCONFIG.SYS; while PTS-DOS opts for CONFIG.PTS.

Due to their DOS heritage, Windows 95 and Windows 98 include both CONFIG.SYS and AUTOEXEC.BAT in their boot drive roots; however, these files are generally left empty. In contrast, Windows Me does not parse CONFIG.SYS during startup but instead retrieves environment variables from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

Within the FlexOS operating system, CONFIG.SYS is formatted as a binary file that specifies resource managers and device drivers loaded at 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>

:;*?!

Used to define labels within CONFIG.SYS, serving as jump points for directives like , , , and .
Functions similarly to , but also permits inline comments following other directives. (MS-DOS/PC DOS handles inline comments differently when enclosed in double quotes.)
Acts as a prefix for inline comments 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.) DOS 6.0 and later versions provide a comparable feature by appending after directives.
Forces unconditional execution of the next CONFIG.SYS directive.

ATemplate:NbndC

Determines whether programs can be aborted upon encountering errors.
Sets which drives record file access timestamps within FAT file systems.
Enables conditional execution on AT-compatible hardware.
Manages boot loading operations.
Adjusts the 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 fundamental device drivers into memory.
Generates a beep sound even if notification sounds are disabled.
Specifies the operating system to load next during boot.
Enables or disables extended Ctrl+C checking functionality.
Defines the number of disk buffers allocated by the system.
Similar to BUFFERS but loads buffers into High Memory Area (HMA) or Upper Memory Blocks (UMB).
, ,
Control cache block allocation and timing for flushing operations.
Executes programs within CONFIG.SYS, pausing further processing until those programs return control.
Sets the keyboard's Caps Lock state.
,
Configures CD-ROM driver name and buffer quantity.
Continues processing CONFIG.SYS from another file or label.
, , , etc., control system clock type, screen clearing behavior, or OEM codepage settings respectively.
, ...,
Define parameters such as count, order, I/O addresses, and timeouts for COM ports.
, ;
Redefine characters that mark inline comments or ignore lines depending on OS implementation.
Enables or configures internationalization support, varying by DOS version.
Additional CPU-specific directives (CPU88, CPU386, CPU486+) provide conditional execution based on processor type in PTS-DOS and DR-DOS.

DTemplate:NbndF

Adjusts relocation settings for drive descriptor tables.
Defines the memory segment limit up to which multi-sector disk data deblocking is permitted.
Activates internal debugger functionality.
Manages boot loading processes.
Loads device drivers into conventional memory.
Loads device drivers into upper memory areas (equivalent to in DRDOS 5.0).
Sets country and codepage configurations for keyboard, screen, and printer devices.
Controls cache memory sizes used by the system.
Determines floppy disk compatibility modes.
Specifies display font settings.
Controls loading of DOS into high memory and/or usage of upper memory areas (similar to in DRDOS 5.0).
Loads DOS tables such as BUFFERS, FCBS, FILES, LASTDRIVE, and STACKS into upper memory regions.
Defines an alternate path for DOS system files.
Sets search paths for data files used by DOS utilities.
Describes physical characteristics of disk drives connected to the system.
Provides parameters for drives that are not otherwise recognized by DOS.
Refer to .
Enables error logging and specifies drive location for log files named PDUMP.nnn.
Outputs a message on the display screen during processing.
Displays messages incorporating ANSI escape codes for formatting.
Determines whether additional validation checks occur when launching programs.
Assigns an assumed error or return code to subsequent commands executed by DOS.
Configures the state of the A20 gate at program startup.
Terminates CONFIG.SYS processing early except for certain SWITCHES and SHELL commands.
Sets hash table size to accelerate file open operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
Specifies the number of cached File Control Blocks (FCBs) that can be open simultaneously (shares buffer space with FILES under DR-DOS).
Functions like FCBS but loads FCBs into upper memory areas instead of conventional memory.
Boot manager functionality for managing multiple boot options.
Defines maximum number of files that can be opened simultaneously by the system.
Similar to FILES but allocates file handles into upper memory blocks rather than conventional memory.
Executes designated subsections within CONFIG.SYS as specified by IGNORE directive.

GTemplate:NbndI

Waits for a key press or timeout, setting 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, then returns to the prior location.[1]
Refer to , , or for additional details.
Consult for further information.
See for related commands.
Refer to or for more context.
See or for relevant usage.
Consult for additional guidance.
Loads TSR (Terminate and Stay Resident) programs into memory following relocation of the DOS data segment. Compare with INSTCDEX.
For more details, see , , or .
Refer to .[1]
See or as related references.
Activates console and command line history buffers with enhanced pattern search capabilities.
Defines the address of the High Memory Area (HMA) segment.
Configures energy-saving settings related to the HLT instruction.
Specifies system checks targeting boot sector viruses.
Loads installable file system drivers.
Prevents execution of certain CONFIG.SYS subsections. Also see: .
Permits specified applications to execute at ring 2, allowing direct hardware I/O access.
Includes directives from another menu block (simulated via GOSUB/RETURN in DR-DOS).
Sets the keyboard Insert mode status.[1]
Installs TSR programs into memory.[2]
Loads TSR programs into upper memory, equivalent to HIINSTALL in DR DOS 5.0.
Installs TSR programs post DOS data segment relocation, similar in function to INSTALL.
Adjusts PIC interrupt priorities, 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.
Functions like LASTDRIVE but additionally loads the Current Directory Structure into upper memory.
Lists paths where DLLs are searched for.
Manages handling of legacy software compatibility.
Determines the number of file locks allowed.
Enables support for boot logos during startup messages.
Configures count, sequence, I/O address, and timeout parameters for LPT1 device.
Applies same configuration parameters as LPT1 but for LPT2 device.
Mirrors LPT1 settings for LPT3 device configuration.
Enables and sets parameters for LPT4 device similarly to LPT1-LPT3.
Defines wait duration before increasing process priority.
Sets strategy for memory allocation management.
Specifies default DOS memory allocation size.
Defines menu option entries.
Sets color schemes for menus (can be emulated in DR-DOS).
Designates default menu block (emulatable in DR-DOS).
Defines individual menu blocks (emulatable in DR-DOS).
Enables operations involving multitrack disks.
Continues processing CONFIG.SYS in a new file, optionally loading a device driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Establishes default character representing No () in Yes/No/Resume prompts.
Sets initial status of keyboard [[Num Lock|Template:Keypress]] key.
Executes conditionally based on previous error code, e.g., .
Displays text and pauses awaiting key input, similar to DR-DOS commands and .
Requires user confirmation when errors occur in CONFIG.SYS processing.
Configures buffer sizes for LPT1 through LPT3 printers.
Executes conditionally on PC-compatible hardware platforms.
Sets priority level within the scheduler system.
Defines priority settings specifically for disk I/O processes.
Changes default printer device driver among LPT1 to LPT3 or LPT4 options.
Specifies whether DOS applications are permitted to run.
Loads a user interface shell environment.
Executes conditionally on IBM PS/1-compatible machines only.
Executes conditionally on IBM PS/2-compatible machines only.
Suppresses output directed to STDOUT.

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.
Establishes the default Resume () prompt character.
Returns nested CONFIG.SYS execution to the previous GOSUB or SWITCH command, optionally with a return code.
Specifies the size of real mode memory available.
Enables concurrent loading of programs in CONFIG.SYS, functioning similarly to CALL or INSTALL commands in DOS.
Designates storage of the first character of deleted files within the FAT reserved area.
Determines video mode settings (FreeDOS) or screen access methods (PTS-DOS).
Configures the status of the keyboard Scroll Lock key.
Assigns environment variable values.
Loads the command interpreter shell.
Functions like SHELL but allows pre-allocation of COMMAND.COM size in HMA to prevent fragmentation, with PTS-DOS loading the shell into UMBs where possible.
Defines keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Indicates whether files should close upon pressing Ctrl+Alt+Del.
Specifies bypassing POST during reboot sequences.
Serves as a compatibility placeholder due to reentrant design in earlier DR DOS releases.
Sets the number of hardware interrupt stacks available.
Defines default stack size for newly created threads.
Similar to STACKS but loads buffers into the upper memory area (UMA).
Configures boot manager settings.
(MS-DOS 3.0 only, ignored in DR-DOS 7.02+)
Directive intended for internal use only.
(PTS-DOS exclusive)
Manages XMS A20 gate control functionality.
(DOS 6.0 and later, except DR-DOS and FreeDOS)
Defines submenu blocks, which can be emulated using CLS, ECHO, and SWITCH commands in DR-DOS.
(OS/2 version 3.0 and above)
Records error information to disk instead of displaying a popup error screen.
(OS/2 exclusive)
Specifies location for swap file storage.
(DR DOS 6.0 and later)
Allows conditional continuation of nested CONFIG.SYS processing at designated labels based on key presses, with RETURN resuming previous execution points.
(DOS variants including DR-DOS 7.02+, PTS-DOS, FreeDOS)
Sets the system-wide default switch character ('/' or '-').
(DOS 4.0, Novell DOS 7 and later)
Specifies special options that are disregarded under PTS-DOS.
(OS/2 Warp 4 FixPak 1 and newer)
Enables a fix addressing FPU rounding errors.
(PTS-DOS exclusive)
Defines filename for an alternative DOS operating system to boot from.
(PTS-DOS exclusive)
Configures memory addresses used by various DOS components.
(PTS-DOS exclusive)
Loads system from an alternate disk location.
(Embedded DOS 6-XL)
Sets the size of dynamic allocation memory pool within system RAM.
(PTS-DOS exclusive)
Specifies loading of DOS data and code into upper memory blocks (UMBs).
(OS/2 only)
Determines maximum number of threads scheduled concurrently by the system scheduler.
(DR DOS 6.0+, PTS-DOS)
Sets timeouts for CONFIG.SYS single-step execution and default responses for queries and SWITCH selections. Only timeout values are supported in PTS-DOS.
(OS/2 only)
Adjusts minimum and maximum time slices for the scheduler.
(PTS-DOS)
Defines the temporary file extension used by the operating system.
(DR-DOS 7.02+, PTS-DOS, OS/2)
Enables or disables single-step execution globally or locally for CONFIG.SYS and AUTOEXEC.BAT, with functionality varying between OS/2 and DOS variants.
(OS/2 only)
Specifies size of TRACE log buffer for diagnostic purposes.
(OS/2 version 3.0+)
Logs comprehensive error details to assist with troubleshooting.

UTemplate:NbndZ

Directs DOS to designate a particular memory segment as an Upper Memory Block (UMB).
Sets up the UMB management service.
Defines the memory address ranges allocated for UMB RAM.
Toggles the verification of disk write operations.
Determines the DOS version presented to applications.
Manages VGA display parameters.
Indicates the active video mode, comparable to FreeDOS's SCREEN setting.
Enables or disables the use of virtual DMA.
Controls the processor's Virtual Mode Extensions (VME) functionality.
Configures the Windows VxD driver settings.
Establishes system support parameters for Windows environments.
Manages relocation settings for the Extended BIOS Data Area.
Enables conditional execution on XT-class machines.
Sets up integrated Year 2000 compliance features.
Defines the default character used for affirmative responses in prompts.
Controls tracking of file deletions.

Issues

Although the system can start without CONFIG.SYS or AUTOEXEC.BAT, these files are critical for complete customization and meeting software demands. Any corruption or loss of these files necessitates diagnostic measures.

In cases where CONFIG.SYS lacks a SHELL directive or is absent/corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to MS-DOS 6.0 will fail if COMMAND.COM is missing, whereas MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later versions will prompt users to specify a command processor path. This prompt also occurs if the main command shell terminates unexpectedly, enabling limited on-the-fly shell replacement without rebooting.

Due to incompatibilities between MS-DOS 7+ COMMAND.COM and DR-DOS, DR-DOS versions 7.02 and above restrict bypassing SHELL directives during skip/trace/step debugging modes (activated via Ctrl+F5/F7/F8). Subsequent updates introduced Ctrl+F6 to reinstate skip functionality, aiding recovery from invalid shell arguments. If no valid SHELL is detected while skipping CONFIG.SYS, users are prompted to input a shell filename before COMMAND.COM loads.

CONFIG.SYS file size is capped under MS-DOS/PC DOS (up to 64 KB in later releases), whereas DR-DOS imposes no such limit, processing directives sequentially rather than compiling them into memory tokens. This approach grants DR-DOS users enhanced flexibility in ordering device drivers and TSRs using DEVICE and INSTALL, facilitating resolution of loading conflicts and incorporation of non-resident programs during startup.

MS-DOS/PC DOS versions from 2.0 through 4.01 restrict SHELL command line lengths to a maximum of 31 characters; later editions support up to 128 characters, and DR-DOS allows lines up to 255 characters. None of the CONFIG.SYS commands accept 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 CONFIG.DOS and AUTOEXEC.DOS respectively to enable dual boot functionality between Windows 9x and DOS. Booting into DOS temporarily restores these files back as CONFIG.SYS and AUTOEXEC.BAT. Additionally, Windows 95 system files are saved as CONFIG.W40 and AUTOEXEC.W40.

In setups where Caldera DR-DOS versions 7.02 or 7.03 coexist with Windows 95, Windows' CONFIG.SYS and AUTOEXEC.BAT remain intact, while DR-DOS utilizes DCONFIG.SYS and AUTODOS7.BAT for its startup configuration.

OS/2 / Windows NT

OS/2 depends extensively on CONFIG.SYS for configuring the system, loading drivers, and setting up the environment prior to launching its graphical user interface.

Within the Windows NT OS/2 subsystem, CONFIG.SYS is not maintained as a file but is instead represented within the system registry.

There are many CONFIG.SYS commands for OS/2 that have not been officially documented.[3]

CONFIG.SYS continues to be utilized by OS/2 successors like 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; DR-DOS 7 commands)
  • FreeDOS CONFIG.SYS command descriptions
  • PTS-DOS 2000 Pro User Guide covering CONFIG.SYS commands
  • Unofficial German FAQ for PTS-DOS including CONFIG.SYS directives (archived)
  1. ↑ 1.0 1.1 1.2 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 Paul_1997_NWDOSTIP
  3. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Childs_1995_OS2