Jump to content

RETURN (CONFIG.SYS directive)

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

CONFIG.SYS serves as the main configuration file utilized by DOS and OS/2 operating systems. This plain text file, written in ASCII format, contains configuration commands accessible to users, which are interpreted by the operating system's DOS BIOS (commonly found in IBMBIO.COM or IO.SYS) during the system startup process. The CONFIG.SYS file was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are responsible for setting up DOS to manage hardware devices, software applications, and memory allocation. Once CONFIG.SYS has been processed, DOS initiates the command interpreter specified on the SHELL line; if none is specified, it defaults to COMMAND.COM, which then executes the commands in AUTOEXEC.BAT.

Typically, this file consists of name=value pairs that establish configuration parameters or load essential files such as device drivers and terminate-and-stay-resident programs (TSRs). CONFIG.SYS is located in the root directory of the bootable drive.

Certain DOS derivatives prioritize alternative filenames over CONFIG.SYS:

- Advanced releases of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or, in the case of Multiuser DOS, CCONFIG.INI instead of CONFIG.SYS. These platforms support additional settings stored in binary files (CCONFIG.BIN), typically edited through CONFIG.EXE.

- In DR DOS versions 3.31 and later, DCONFIG.SYS takes precedence over CONFIG.SYS and is commonly employed alongside disk compression utilities or multi-boot environments. OpenDOS 7.01 and DR-OpenDOS 7.02 also recognize ODCONFIG.SYS, while certain DR-DOS editions check for DRCONFIG.SYS.

- Starting with DR-DOS 6.0, the default file extensions can be modified using SYS /DR:ext, enabling multiple system file sets to coexist in a single root directory and be selected via boot managers like LOADER.

Additional enhancements include specifying alternative AUTOEXEC.BAT files through SHELL /P[:filename.ext], support for chaining multiple configuration files using CHAIN=filespec[,label], and copying system files with SYS /A introduced in DR-DOS 7.03 and newer.

Other DOS-based operating systems implement comparable configuration files: FDCONFIG.SYS in FreeDOS, RXCONFIG.SYS in RxDOS version 7.24 and above, and CONFIG.PTS in PTS-DOS.

In Windows 95 and 98, which are built on DOS, CONFIG.SYS and AUTOEXEC.BAT exist but often contain no commands. Windows Me does not process CONFIG.SYS during boot; instead, it loads environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

Within FlexOS, CONFIG.SYS is a binary-format file that specifies resource managers and device drivers loaded during initialization.

Example

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>

:;*?!

Defines labels within CONFIG.SYS used as jump targets for , , , and commands.
Functions similarly to , allowing inline comments after directives. (MS-DOS/PC DOS does not ignore inline comments enclosed in double quotes.)
Used at the start of inline comments along with ;.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS instructions. (FreeDOS supports optional conditions with boot menus but lacks message prompts.) DOS versions 6.0 and later provide a comparable feature by appending to directives.
Executes the following CONFIG.SYS command unconditionally.

ATemplate:NbndC

Determines whether programs may be terminated upon encountering errors.
Sets which drives record file access timestamps within FAT filesystems.
Enables conditional command execution on AT-compatible hardware.
Manages boot loading operations.
Adjusts the level of detail in 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 fundamental device driver into memory.
Produces a beep sound even if audible alerts are disabled.
Specifies the next operating system to launch.
Activates or deactivates extended Ctrl+C detection.
Defines the quantity of disk buffers allocated.
Functions similarly to BUFFERS but loads buffers into HMA or UMB areas.
, ,
Sets cache size and timing parameters for system performance tuning.
Executes programs within CONFIG.SYS, pausing further processing until completion.
Controls the Caps Lock key status on the keyboard.
,
Configures CD-ROM driver name and buffer allocation count.
Continues processing CONFIG.SYS commands from a different file or label.
, , , and other hardware or display-related settings tailor system behavior under specific DOS variants.
, ...,
Establish count, sequence, I/O port addresses, and timeout values for COM ports.
, also COMMENTS, manage inline comment handling across various DOS versions.
Provides internationalization support (DOS 3.0+, DR DOS 3.31+, OS/2).
CPU-specific directives (CPU88, CPU386, CPU486, etc.) allow conditional execution depending on CPU type (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 capabilities.
Boot loading manager utility.
Loads a device driver into standard memory space.
Loads a device driver into upper memory area (equivalent to in DRDOS 5.0).
Sets country and code page configurations for keyboard, screen, and printer devices.
Configures cache memory sizes for optimized performance.
Specifies compatibility mode for floppy disk drives.
Selects display font parameters.
Determines whether DOS loads into high memory area and/or utilizes upper memory (similar to under DRDOS 5.0).
Specifies if DOS tables (, , , etc.) should be loaded into upper memory segments.
Defines an alternate directory path for locating DOS files.
Sets search paths for data files used by the system.
Provides physical characteristics of disk drives to the system.
Establishes parameters for drives not automatically recognized by the system.
Refer to .
Enables error logging and designates the drive used for storing logs.
Outputs a message directly onto the display screen.
Displays messages incorporating ANSI escape codes for enhanced formatting.
Indicates whether additional validation checks are performed when launching programs.
Assigns a specific error or return code for subsequent operations.
Defines the state of the A20 gate at program startup.
Terminates CONFIG.SYS processing prior to reaching the end of the file (with some exceptions).
Sets hash table size used for accelerating file open operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
Number of cached File Control Blocks that can be open simultaneously (shares buffer with FILES in DR-DOS).
Same as FCBS but loads these buffers into upper memory regions.
Boot management utility function.
Specifies how many files may be opened concurrently by the system.
Same as FILES but loads file handles into upper memory areas.
Executes specified subsections of CONFIG.SYS (see IGNORE directive).

GTemplate:NbndI

Waits for a keypress or timeout, assigning the error level to the ASCII value of the key or 1024 if timed out.
Resumes processing of CONFIG.SYS at a designated label.
Continues nested CONFIG.SYS processing at a specific label, then returns to the prior point.
Refer to , , or for details.
See also .
Additional information available in .
Consult or for related functions.
For more, see or .
Further details in .
Loads a TSR program into memory following DOS data segment relocation; compare with INSTCDEX.
Refer to , , or for more information.
Additional references include .
See or for related commands.
Activates console and command line history buffers with advanced pattern matching capabilities.
Defines the address of the High Memory Area (HMA) segment.
Configures energy-saving behavior via HLT instruction.
Enables scanning for boot sector viruses.
Loads installable file system drivers.
Prevents execution of specified CONFIG.SYS subsections.
Specifies programs permitted to operate at ring 2 for direct hardware access.
Includes directives from another menu block, emulated through GOSUB/RETURN in DR-DOS.
Sets the status of the keyboard Insert mode.
Installs a TSR program into memory.
Loads TSR programs into upper memory (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSR software after DOS data segment relocation, similar to INSTCDEX.
Adjusts PIC interrupt priority to favor a designated IRQ number.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the relocated keyboard buffer address.
Sets the maximum number of accessible drives.
Functions like LASTDRIVE but loads Current Directory Structure into upper memory.
Lists directories used for DLL searching.
Controls handling of legacy programs.
Indicates the number of file locks allowed.
Configures support for boot logos and startup messages display.
Defines parameters such as count, order, I/O address, and timeout for LPT1 device.
Mirrors LPT1 settings for LPT2 device configuration.
Applies LPT1 parameters similarly to LPT3 device.
Enables and configures LPT4 device in the same manner as others.
Sets delay before elevating priority of waiting processes.
Determines strategy for memory allocation management.
Specifies default DOS memory allocation approach.
Defines options available in menus.
Sets color schemes for menus (can be emulated under DR-DOS).
Designates default menu block (emulatable in DR-DOS).
Defines multiple menu blocks (also emulatable under DR-DOS).
Enables multitrack operations on disk drives.
Continues processing CONFIG.SYS from a new file after loading a device driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Sets default character representing No () in Yes/No/Resume prompts.
Specifies whether keyboard [[Num Lock|Template:Keypress]] is enabled or disabled at startup.
Executes commands conditionally based on previous error code, e.g., .
Displays text and waits for key input, similar to and in DR-DOS environments.
Requires user confirmation when errors occur during CONFIG.SYS processing.
Configures buffer sizes assigned to LPT ports.
Allows conditional execution on PC-compatible systems only.
Sets scheduler priority level for processes.
Defines priority settings for disk input/output operations.
Changes default printer device driver assignment (e.g., from LPT1 to LPT3 or LPT4).
Controls whether DOS applications are permitted to execute.
Loads a user interface shell environment.
Enables conditional command execution on IBM PS/1-compatible machines only.
Enables conditional command execution 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.
Reserves a drive letter to prevent its use by local block device drivers.
Establishes the default Resume () character utilized in Yes/No/Resume prompts.
Returns nested CONFIG.SYS processing control to the previous GOSUB or SWITCH location, optionally providing a return code.
Specifies the size of real mode memory.
Functions similarly to CALL or INSTALL by loading programs concurrently in the background during CONFIG.SYS processing.
Saves the first character of deleted files within the FAT reserved area.
Defines video mode settings (FreeDOS) or screen access methods (PTS-DOS).
Sets the status of the Scroll Lock key, turning it on or off.
Declares environment variables.
Loads the command interpreter shell.
Comparable to SHELL but includes a SIZE parameter for pre-allocating COMMAND.COM in HMA or UMBs, enhancing memory efficiency with third-party shells.
Specifies keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Determines whether files are closed upon pressing Ctrl+Alt+Del.
Bypasses POST during reboot sequences.
, STACKSIZE, STACKSHIGH
Configure interrupt stack sizes and buffer placements across various DOS versions and platforms to optimize memory handling.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
PTS-DOS commands that manage boot procedures, system memory allocation, alternative OS loading, and upper memory block utilization to improve flexibility and performance.
, SWITCH, SWITCHES
Enable conditional processing of CONFIG.SYS and option settings primarily supported in DOS variants other than DR-DOS and FreeDOS.
, SWAPPATH
OS/2 directives that define error log locations and swap file directories for enhanced system stability management.
, THREADS, TIMESLICE
OS/2 parameters that adjust FPU bug fixes, number of concurrent threads, and scheduler time slices to boost system performance.
, TRACE, TRACEBUF
Control CONFIG.SYS execution timeouts, enable single-step debugging modes, and set trace log buffer sizes across DOS variants for improved troubleshooting capabilities.
, TRAPDUMP
Defines temporary file extensions (PTS-DOS) and detailed error logging options (OS/2) to facilitate system diagnostics and maintenance.

UTemplate:NbndZ

Configures DOS to utilize a specified segment as Upper Memory Block (UMB) space.
Selects the UMB server employed by the system.
Defines address ranges designated as UMB RAM.
Enables or disables verification of disk writes.
Reports a specific DOS version to software applications.
Sets VGA display status parameters.
Specifies the current video mode, akin to FreeDOS's SCREEN directive.
Enables or disables virtual DMA usage.
Determines whether processor Virtual Mode Extensions are disabled.
Configures VxD driver settings for Windows environments.
Manages Windows system support configurations.
Controls relocation of the Extended BIOS Data Area (EBDA).
Executes conditionally on XT-compatible hardware platforms.
Enables built-in Year 2000 compliance support.
Defines the default affirmative character used in prompts.
Manages deletion tracking features.

Issues

Although it is possible for the system to start without CONFIG.SYS or AUTOEXEC.BAT files, these components are critical for a full DOS initialization process that customizes both the operating system and application requirements. Their absence or corruption necessitates troubleshooting interventions.

If the SHELL directive is missing from CONFIG.SYS—or if the file itself is corrupted or absent—DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Earlier versions prior to 6.0 will fail to boot without this file. MS-DOS version 6.0, PC DOS 6.1, and Novell DOS 7 and later instead prompt users to specify a command processor path. This prompt also appears when the primary shell terminates unexpectedly or exits.[1] This mechanism allows limited runtime shell replacement without requiring a reboot.

COMMAND.COM from MS-DOS version 7.0 onward is not compatible with DR-DOS,[2] which often resides on drive C: within dual-boot configurations. Starting with DR-DOS version 7.02, skipping or tracing through SHELL directives is disallowed to prevent conflicts.[3] Subsequent updates introduced key combinations enabling users to restore skip functionality when recovering from invalid SHELL arguments.[4] If no SHELL directive is found while skipping CONFIG.SYS processing, users are prompted to enter a valid shell filename before COMMAND.COM is loaded.[3]

In MS-DOS and PC DOS, CONFIG.SYS file size is limited to a few kilobytes (up to 64 KB in later versions), whereas DR-DOS imposes no such restrictions due to its distinct processing approach.[1] MS-DOS compiles CONFIG.SYS into a tokenized format before sequentially processing directives—loading device drivers prior to TSRs—while DR-DOS interprets each line individually. This approach grants precise control over loading order via DEVICE and INSTALL, facilitating resolution of load conflicts and supporting conditional execution based on hardware presence or error conditions.[3] Additionally, the INSTALL command can execute non-resident programs integrated into CONFIG.SYS processing.[5]

The length limit for SHELL lines was capped at 31 characters in MS-DOS/PC DOS versions 2.0 through 4.01 but expanded up to 128 characters in later releases. DR-DOS supports up to 255 characters.[5] It should be noted that CONFIG.SYS directives 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. During a DOS boot, these files are temporarily restored as CONFIG.SYS and AUTOEXEC.BAT. Meanwhile, 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 original Windows CONFIG.SYS and AUTOEXEC.BAT remain unaltered. Instead, DR-DOS relies on DCONFIG.SYS and AUTODOS7.BAT for its boot sequence.[6]

OS/2 / Windows NT

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

Within the OS/2 subsystem of Windows NT, the CONFIG.SYS configuration visible to OS/2 applications is actually maintained within the system registry.

There exists a variety of undocumented CONFIG.SYS commands specific to OS/2.[7]

CONFIG.SYS continues to play a critical role in OS/2-based operating systems such as eComStation[8] and ArcaOS.[9]

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
  • Description of FreeDOS CONFIG.SYS directives
  • PTS-DOS 2000 Pro User Guide with details on CONFIG.SYS directives
  • Unofficial German PTS-DOS FAQ (2004) including extra CONFIG.SYS command explanations
  1. ↑ 1.0 1.1 Cite error: Invalid <ref> tag; no text was provided for refs named Paul_1997_NWDOSTIP
  2. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Paul_2004_COMMAND
  3. ↑ 3.0 3.1 3.2 Cite error: Invalid <ref> tag; no text was provided for refs named Paul_1997_OD-A3
  4. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Paul_2004_YESCHAR
  5. ↑ 5.0 5.1 Cite error: Invalid <ref> tag; no text was provided for refs named 4DOS_8.00_HELP
  6. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Caldera_1998_USER
  7. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named Childs_1995_OS2
  8. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named ecom_2001
  9. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named ArcaOS_2020