EXIT (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Operating systems |
| Founded | 1983 |
| Products | DOS and OS/2 configuration |
CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, holds setup instructions accessible to users, which are interpreted by the operating system's DOS BIOS—typically found in IBMBIO.COM or IO.SYS—during the boot process. CONFIG.SYS was first introduced with DOS version 2.0.
Usage
The directives within CONFIG.SYS configure DOS to manage devices, applications, and memory allocation. Once CONFIG.SYS is processed, DOS initiates the command interpreter specified by the SHELL command; if none is specified, it defaults to COMMAND.COM, which then executes the AUTOEXEC.BAT script.
This configuration file primarily contains name=value pairs that set adjustable parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs) into memory.
In DOS environments, CONFIG.SYS is located in the root directory of the boot drive.
The same filename is utilized by (DCP), a variant of MS-DOS developed by East-German company VEB Robotron.
Certain DOS derivatives check for alternative filenames that override CONFIG.SYS:
- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 prioritize CCONFIG.SYS (short for "Concurrent") instead of CONFIG.SYS. Multiuser DOS may also employ CCONFIG.INI, while REAL/32 looks for MCONFIG.SYS. These systems support additional configuration stored in a binary file called CCONFIG.BIN, usually edited through CONFIG.EXE.
- In DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, and DR-DOS versions 7.02 and later, DCONFIG.SYS (derived from "DR DOS") takes precedence over CONFIG.SYS. Originally designed for disk compression utilities to handle drive letter reassignment, it also enables multiple configuration files to coexist in multi-boot environments.
- OpenDOS 7.01 and DR-OpenDOS 7.02 search for ODCONFIG.SYS; some DR-DOS 7.02+ editions additionally look for DRCONFIG.SYS.
- Starting with DR DOS 6.0, users can modify default system file extensions using SYS /DR:ext, allowing multiple system files with different extensions to reside simultaneously in one root directory. Boot managers like LOADER in Multiuser DOS and DR-DOS 7.x can select among these variants at startup.
- The SHELL directive supports specifying alternate AUTOEXEC.BAT files via /P[:filename.ext], and COMMAND.COM accepts batch files with extensions other than ".BAT"—functionality also provided by 4DOS.
- DR DOS 6.0 and newer versions introduce CHAIN=filespec, enabling continuation of configuration processing from another file located outside the root directory; from DR-DOS 7.02 onward, an optional label parameter allows jumping directly to a specific section within that file.
- With DR-DOS 7.03 and later, the command SYS /A was added to copy matching CONFIG.SYS and AUTOEXEC.BAT files alongside system files.
Other operating systems use similar alternate filenames: FDCONFIG.SYS in FreeDOS, RXCONFIG.SYS in RxDOS, and CONFIG.PTS in PTS-DOS.
In Windows 95 and Windows 98, both CONFIG.SYS and AUTOEXEC.BAT exist in the boot drive’s root folder but are generally left empty. Windows Me does not process CONFIG.SYS during startup; instead, it loads environment variables from the Windows Registry at HKLM\System\CurrentControlSet\Control\SessionManager\Environment.
For the FlexOS operating system, CONFIG.SYS is a binary file that specifies resource managers and device drivers loaded during system initialization.
Example
Below is a sample CONFIG.SYS file configured 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 within CONFIG.SYS to serve as jump points for , , , , and commands.
- Functions similarly to , also used for inline remarks following other CONFIG.SYS instructions. (Note that in MS-DOS/PC DOS, inline comments inside quotes are processed literally.)
- Introduces inline commentary alongside the ; directive.
- Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS lines.[1] (FreeDOS supports conditional execution with boot menus but lacks customizable messages.) DOS version 6.0 and later implement a comparable feature by appending to directives.
- Forces unconditional execution of the next CONFIG.SYS command.
ATemplate:NbndC
- Determines whether programs can be interrupted when errors occur.
- Sets which drives record file access timestamps on FAT file systems.
- Enables conditional operations on AT-compatible hardware.
- Acts as a boot management utility.
- Adjusts verbosity level of error messages.
- Alters the default serial port driver (COM1–COM4) assigned to the AUX device.
- Prevents loading of character devices located outside the phantom \DEV directory.
- Loads fundamental device drivers into memory.
- Produces an audible beep even if sound notifications are disabled.
- Defines the subsequent operating system to boot.
- Activates or deactivates extended Ctrl+C interrupt checking.
- Configures the number of disk buffers allocated.
- Similar to BUFFERS but places buffers into High Memory Area (HMA) or Upper Memory Blocks (UMB).
- , , (Embedded DOS 6-XL only)
- Control cache block allocation and flushing behavior.
- Executes programs within CONFIG.SYS, running them in the foreground and pausing further processing until completion.
- Sets keyboard Caps Lock state.
- , (PTS-DOS only)
- Configures CD-ROM driver name and buffer quantities.
- Continues processing CONFIG.SYS from a new file or label location.
- , , and other PTS-DOS-specific commands adjust system clock type, screen clearing, color schemes, and other customization aspects.
- (OS/2 only)
- Defines OEM code pages for internationalization support.
- (DR-DOS 7.02+)
- Specifies serial COM port count, order, I/O addresses, and timeouts.
Other directives handle device driver loading, memory buffer allocation, CPU-based conditional execution, international settings, keyboard status adjustments, and more—essential for optimizing system configurations in business environments utilizing legacy DOS platforms.
DTemplate:NbndF
- Manages relocation of drive descriptor tables.
- Sets the memory segment limit up to which multi-sector disk data deblocking is permitted.
- Enables support for an internal debugging tool.
- Functions as a boot manager utility.
- Loads a specified device driver into system memory.
- Loads a device driver into upper memory area (equivalent to in DRDOS 5.0).
- Configures country and code page information for keyboard, screen, and printer devices.
- Sets cache memory sizes for performance optimization.
- Selects compatibility mode for floppy disk drives.
- Specifies display font settings.
- Controls loading DOS into high memory area and/or upper memory usage (similar to in DRDOS 5.0).
- Loads DOS internal tables (, , , etc.) into upper memory segments.
- Defines alternative paths for DOS system files.
- Specifies search paths for data files used by the system.
- Defines physical parameters for disk drives.
- Establishes parameters for drives not natively recognized by DOS.
- See .
- Enables error log creation on specified drives using
PDUMP.nnnfiles. - Displays a simple message on the screen during boot or processing.
- Outputs messages including ANSI escape sequences for formatting effects.
- Adds extra verification steps when launching programs.
- Sets expected error or return codes for subsequent operations during batch processing.
- Controls A20 line gate state when initiating programs to manage memory addressing modes.
- Terminates CONFIG.SYS processing prematurely except where certain directives require continuation.
- Adjusts hash table size used to speed up file open operations, differing from MS-DOS/PC DOS external drivers.
- Specifies how many File Control Blocks (FCBs) can be open simultaneously (shares buffer space with FILES under DR-DOS).
- Similar to FCBS but loads these buffers into upper memory areas.
- Acts as a boot manager tool within CONFIG.SYS processing.
- Determines the maximum number of files that may be opened concurrently by the system.
- Equivalent to FILES but ensures file handles are loaded into upper memory explicitly.
- Includes execution of designated CONFIG.SYS subsections via IGNORE command.
GTemplate:NbndI
- Pauses for a key press or timeout, setting 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 execution at a specified label and returns to the previous point afterward.
- Refer to , , or for additional details.
- See also .
- Consult .
- Refer to or for further information.
- See or for related commands.
- Consult .
- Loads TSR programs into memory following DOS data segment relocation. Compare with INSTCDEX.
- See , , or for related instructions.
- Refer to .
- See or for more options.
- Enables history buffers for console and command line, along with enhanced pattern matching.
- Defines the address of the HMA segment.
- Configures power-saving mode using HLT instruction.
- Performs boot sector virus scanning during startup.
- Loads installable file system drivers.
- Prevents execution of specific CONFIG.SYS subsections.
- Permits programs to operate at ring 2, allowing direct hardware I/O access.
- Incorporates directives from another menu block (can be emulated using GOSUB/RETURN in DR-DOS).
- Sets the status of keyboard Insert mode.
- Loads TSR programs into memory.
- Installs TSR programs into upper memory, equivalent to HIINSTALL in DR DOS 5.0.
- Installs TSR after relocating DOS data segment, similar to INSTALL command.
- (Embedded DOS 6-XL only)
- Adjusts PIC interrupt priorities by assigning highest priority to a specified number.
KTemplate:NbndM
- Defines the keyboard layout configuration.
- Specifies the location of the relocated keyboard buffer in memory.
- Sets the maximum number of drives accessible by the system.
- Functions like LASTDRIVE but also loads Current Directory Structure into upper memory area.
- Lists paths where DLL files are searched for.
- Provides compatibility settings for legacy applications.
- Configures the number of file locks permitted.
- Manages boot logo display settings when using PTS-DOS boot manager.
- Configures LPT1 device parameters including count, order, I/O address, and timeout duration.
- Sets LPT2 device parameters similarly with count, order, I/O address, and timeout values.
- Defines LPT3 device settings including count, order, I/O address, and timeout period.
- Enables and configures LPT4 device with similar parameters as other LPT ports.
- Determines wait duration before elevating process priority.
- Specifies strategy for memory allocation management.
- Sets default method for allocating DOS memory resources.
- Defines available menu options within the system configuration.
- Specifies color schemes used in menus (can be emulated under DR-DOS).
- Sets default menu block selection (emulatable in DR-DOS).
- Defines multiple menu blocks (also emulatable under DR-DOS).
- Enables or disables multitrack disk operation support.
- Continues processing CONFIG.SYS from a new file after driver loading and assigns %NEWFILE% environment variable.
NTemplate:NbndQ
- Establishes default character used for No () responses in Yes/No/Resume prompts.
- Sets initial status of keyboard [[Num Lock|Template:Keypress]] key at startup.
- Enables conditional command execution based on previous error code, such as .
- Displays text message and pauses for user key press, similar to and commands in DR-DOS environments.
- Requires user confirmation upon encountering errors in CONFIG.SYS files.
- Configures buffer sizes assigned to LPT ports for printing devices.
- Allows conditional execution when running on PC-compatible hardware platforms.
- Adjusts scheduler priority levels for processes.
- Sets priority specifically for disk I/O related programs.
- Changes default printer driver assignment (e.g., switching from LPT1 to LPT3 or LPT4).
- Restricts execution of certain DOS applications from running on the system.
- Loads a user interface shell environment during startup sequence.
- Conditional execution targeting IBM PS/1-compatible systems only.
- Conditional execution targeting IBM PS/2-compatible systems only.
- Suppresses output directed to STDOUT stream.
RTemplate:NbndT
- Activates automatic system reboot upon encountering errors.
- Permits inclusion of comments within CONFIG.SYS files.
- Allocates a drive letter specifically for local block device drivers.
- Establishes the default Resume () character displayed in command prompts.
- Allows nested CONFIG.SYS processing to return to the previous GOSUB or SWITCH location, optionally with a return code.
- Specifies the size of real mode memory available.
- Enables concurrent background loading of programs during CONFIG.SYS execution.
- Saves the initial character of deleted files in the FAT reserved area.
- Determines video mode under FreeDOS or sets screen access method for PTS-DOS.
- Controls the status of the keyboard Scroll Lock key.
- Defines environment variables for system use.
- Loads the command interpreter shell into memory.
- Functions similarly to SHELL but includes a size parameter, allowing COMMAND.COM to be loaded into HMA or UMBs, enhancing memory efficiency with third-party shells.[2]
- Sets keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
- Manages file closures triggered by Ctrl+Alt+Del interrupts.
- Bypasses POST during system reboot sequences.
- Specifies the number of hardware interrupt stacks available.
- Defines default stack size allocated for new threads.
- Similar to STACKS but loads buffers into the upper memory area (UMA).
- Configures boot manager settings.
- Reserved for internal system use directives.
- Regulates XMS A20 gate functionality.
- Defines submenu blocks compatible with DR-DOS emulation.
- Redirects error logging to a drive instead of popup error screens.
- Sets the path location for swap files.
- Enables conditional continuation of nested CONFIG.SYS processing at specified labels based on key presses, with RETURN commands reverting to previous locations.[2]
- Establishes the default system switch character, either '/' or '-'.
- Specifies particular options affecting CONFIG.SYS processing behavior.
- Activates a workaround for floating-point unit (FPU) rounding errors.
- Indicates an alternative DOS system file for boot operations.
- Configures memory addresses used by DOS components.
- Loads system files from an alternative disk region.
- Defines the size of the dynamic system memory pool allocation.
- Loads DOS data and code into Upper Memory Blocks (UMBs).
- Sets the maximum number of concurrent threads supported by the OS scheduler.
- Adjusts timeout durations for CONFIG.SYS single-stepping, SWITCH selections, GETKEY commands, and default prompt responses.[2]
- Configures minimum and maximum time slices utilized by the scheduler.
- Specifies the temporary file extension used by the operating system.
- Enables or disables single-step execution mode for CONFIG.SYS and AUTOEXEC.BAT scripts.[3]
- Defines the size of the TRACE log buffer used for diagnostics.
- Records detailed error information to assist in troubleshooting.
UTemplate:NbndZ
- Directs DOS management to utilize a designated segment as Upper Memory Block (UMB) space.
- Determines which UMB server is employed.
- Identifies address ranges allocated as UMB RAM.
- Toggles disk write verification on or off.
- Specifies the DOS version number that is reported to applications.
- Configures VGA display status parameters.
- Sets current video mode similarly to FreeDOS's SCREEN command.
- Indicates if virtual DMA support is enabled.
- Controls whether processor Virtual Mode Extensions (VME) are disabled.
- Manages configuration settings for Windows VxD drivers.
- Adjusts system-level support features for Windows environments.
- Modifies relocation settings for the Extended BIOS Data Area (XBDA).
- Enables conditional execution exclusively on XT-compatible hardware.
- Implements built-in Year 2000 compliance support.
- Establishes default 'Yes' character used in prompt responses.
- Manages tracking of file deletions within the system.
Issues
While the system can start without CONFIG.SYS, this file, along with AUTOEXEC.BAT, is crucial for comprehensive DOS startup customization and meeting software prerequisites. Troubleshooting becomes necessary if these files are missing or damaged.
In cases where CONFIG.SYS does not include a SHELL command or is absent/corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Earlier MS-DOS versions prior to 6.0 will fail to boot if COMMAND.COM is not found, whereas MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later versions prompt the user to specify a command processor path. This feature allows recovery or replacement of the runtime shell without requiring a system reboot.
Because MS-DOS 7 and later versions’ COMMAND.COM is incompatible with DR-DOS, DR-DOS 7.02 and newer prevent skipping SHELL directives during skip, trace, or step operations. If no valid shell filename is detected before loading COMMAND.COM, users are prompted to provide one.
The maximum size of CONFIG.SYS differs depending on the operating system: MS-DOS and PC DOS limit its size (up to 64 KB), while DR-DOS imposes no such restriction beyond the file system limits. This is due to DR-DOS processing directives line by line, which allows for meticulous control over load sequence and conditional execution based on hardware detection or error conditions.
For MS-DOS/PC DOS versions 2.0 through 4.01, SHELL lines are limited to 31 characters; later editions extend this limit up to 128 characters. DR-DOS supports even longer lines, up to 255 characters. It should be noted that CONFIG.SYS directives do not accommodate long filenames.
Dual booting DOS and Windows 9x
When Windows 95 is installed on top of an existing DOS or Windows setup, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed to CONFIG.DOS and AUTOEXEC.DOS respectively, enabling dual-boot functionality. During a DOS boot session, these files are temporarily restored to their original filenames. Backup copies of Windows 95 configuration files are saved as CONFIG.W40 and AUTOEXEC.W40.
In systems where Caldera DR-DOS 7.02 or 7.03 coexists with Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT remain unaltered; instead, DR-DOS uses DCONFIG.SYS and AUTODOS7.BAT for its startup configurations.
OS/2 / Windows NT
OS/2 depends extensively on CONFIG.SYS for setting up system parameters, device drivers, and environment variables before launching its graphical user interface.
Within the OS/2 subsystem running under Windows NT, CONFIG.SYS configurations are visible to OS/2 applications but are actually stored within the Windows registry.
There are numerous undocumented CONFIG.SYS commands available in OS/2.
CONFIG.SYS continues to be a fundamental component in OS/2 derivatives such as eComStation and ArcaOS.
See also
- IBMBIO.COM / IO.SYS
- IBMDOS.COM / MSDOS.SYS
- CONFIG (environment variable)
- AUTOEXEC.BAT
- COMMAND.COM
- List of DOS commands
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; DR-DOS 7 directives)
- FreeDOS CONFIG.SYS directive descriptions
- PTS-DOS 2000 Pro User Manual including CONFIG.SYS directives (archived)
- German-language unofficial PTS-DOS FAQ (PTS/FAQD) covering CONFIG.SYS directives