ONERROR (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Operating systems |
| Founded | 1983 |
| Products | System configuration commands for DOS and OS/2 |
CONFIG.SYS serves as the central configuration file for the DOS and OS/2 operating system platforms. This plain text file, written in ASCII, holds configuration commands that the operating system's DOS BIOS—usually contained in IBMBIO.COM or IO.SYS—interprets during the system startup. 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 support hardware devices, software applications, and memory management utilities. Once CONFIG.SYS has been processed, DOS launches the command interpreter specified by the SHELL directive; if none is specified, it defaults to COMMAND.COM, which then executes AUTOEXEC.BAT.
Typically, this file consists of name=value entries that either adjust configurable parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs) into system memory.
In DOS environments, CONFIG.SYS is located in the root directory of the bootable drive.
Certain DOS variants recognize alternative filenames that override the standard CONFIG.SYS:
- Advanced iterations of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI, with settings stored in a binary file called CCONFIG.BIN. These platforms provide extended options like INIT_INSTALL, which is managed through CONFIG.EXE.
- Versions of DR DOS starting from 3.31, including distributions like PalmDOS, Novell DOS, and OpenDOS, prioritize DCONFIG.SYS over CONFIG.SYS. This feature supports configurations involving multiple boot environments and disk compression scenarios where drive letters may change after startup.
- OpenDOS 7.01 and DR-OpenDOS 7.02 also check for the presence of ODCONFIG.SYS, while some DR-DOS releases from 7.02 onward look for DRCONFIG.SYS.
- From DR-DOS 6.0 onward, users can specify custom default file extensions using SYS /DR:ext, allowing multiple system configuration files to coexist within a single root directory and be selected via boot managers like LOADER.
- The SHELL command supports defining alternative AUTOEXEC.BAT filenames using /P[:filename.ext], with COMMAND.COM accepting extensions other than .BAT when invoked this way.
- In DR-DOS, the CHAIN=filespec instruction enables continuation of configuration processing in another file located anywhere on the disk, not just in the root folder; newer versions allow jumping directly to labeled sections within these files.
- Starting with DR-DOS 7.03, a SYS /A option exists to copy both CONFIG.SYS and AUTOEXEC.BAT alongside system files.
Other DOS-based systems offer comparable functionality:
- FDCONFIG.SYS is used by FreeDOS - RXCONFIG.SYS is employed by RxDOS version 7.24 and later - CONFIG.PTS is utilized in PTS-DOS
In Windows 95 and Windows 98—both built on DOS—CONFIG.SYS and AUTOEXEC.BAT files remain present but are generally left empty. Windows Me does not process CONFIG.SYS during startup; instead, it loads environment variables directly from the Windows Registry.
Within the FlexOS operating system, CONFIG.SYS takes a binary form that specifies resource managers and device drivers to be loaded at boot time.
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>
:;*?!
- Establishes labels within CONFIG.SYS to serve as jump destinations for , , , , and commands.
- Functions similarly to , but permits comments to be added on the same line after directives. (In MS-DOS/PC DOS, inline comments enclosed in double quotes are not disregarded.)
- Introduces inline commentary alongside the ; command.
- Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS instructions. (FreeDOS lacks customizable messages but supports conditional execution with boot menus.) DOS 6.0 and later provide a comparable feature by appending to directives.
- Forces unconditional execution of the following CONFIG.SYS command.
ATemplate:NbndC
- Determines whether programs can be terminated upon encountering errors.
- Configures drives to maintain file access timestamps within FAT directory entries.
- Enables conditional execution on AT-compatible hardware.
- Boot management utility.
- Adjusts verbosity level of error messages.
- Alters the default serial device driver (COM1 through COM4) assigned to the AUX device.
- Disables character devices located outside the phantom \DEV directory.
- Loads a fundamental device driver into memory.
- Produces a beep sound regardless of notification settings.
- Designates the operating system to boot next.
- Enables or disables extended Ctrl+C interrupt checking.
- Defines the quantity of disk buffers.
- Similar to BUFFERS but allocates buffers in HMA or UMB areas.
- , CACHETTL, CACHEFLUSH (Embedded DOS 6-XL exclusive)
- Manage cache block allocation and flushing intervals.
- Executes programs within CONFIG.SYS, pausing processing until program returns control.
- Sets the keyboard’s Caps Lock status at startup.
- , CDDBUFFERS (PTS-DOS specific)
- Configures CD-ROM driver name and buffer count.
- Continues processing CONFIG.SYS from a specified file or label.
- , CLS, CODEPAGE (PTS-DOS or OS/2 only)
- Configure system clock type, clear screen display, and OEM codepages.
- , COLOR (PTS-DOS exclusive)
- Defines CMOS RAM address and boot menu color scheme.
- , COM2, COM3, COM4 (DR-DOS 7.02+)
- Set serial port parameters including I/O address and timeout values.
- , COMMENT(S), COUNTRY, CPOS, CPSW
- Various system configurations for inline comments, internationalization support, cursor positioning, and codepage switching across different DOS versions.
- , CPU88, CPU86, CPU286, CPU386, CPU486 series (PTS-DOS and DR-DOS)
- Conditional execution directives based on processor type or generation.
This summary emphasizes critical CONFIG.SYS commands that influence system setup and compatibility across DOS platforms, focusing on essential customization options for both hardware and software environments.
DTemplate:NbndF
- Configures relocation parameters for drive descriptor tables.
- Defines memory segment address used for multi-sector disk data deblocking operations.
- Activates internal debugger support functionality.
- Boot management utility.
- Loads device drivers into conventional memory space.
- Loads device drivers into upper memory blocks (equivalent to in DRDOS 5.0).
- Sets country and codepage information for keyboard, screen, and printer devices.
- Adjusts cache memory sizes for improved performance.
- Defines floppy disk compatibility mode settings.
- Specifies font used for display output.
- Controls whether DOS loads into high memory area or upper memory blocks (similar to in DRDOS 5.0).
- Loads DOS internal tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory areas.
- Specifies an alternate directory path for DOS system files.
- Sets search paths for data files utilized by DOS commands.
- Defines physical disk drive characteristics and parameters.
- Establishes parameters for drives not recognized by default configurations.
- See .
- Enables error logging with PDUMP.nnn files on specified drives.
- Displays text messages on screen during boot or configuration stages.
- Outputs messages incorporating ANSI escape sequences for enhanced formatting.
- Enforces additional validation checks when launching programs.
- Specifies an error or return code to assume upon next operation.
- Controls A20 gate state upon program startup to manage memory access above 1MB boundary.
- Terminates CONFIG.SYS processing prematurely except under certain conditions involving SWITCHES and SHELL commands.
- Configures hash table size used for accelerated file open operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
- Sets number of cached File Control Blocks (FCBs) allowed open simultaneously (shares buffer with FILES under DR-DOS).
- Functions like FCBS but loads FCBs into upper memory blocks instead of conventional memory.
- Boot management utility.
- Specifies maximum number of concurrently opened files allowed by the system.
- Similar to FILES but allocates file handles into upper memory areas rather than conventional memory.
- Incorporates execution of designated CONFIG.SYS subsections 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 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 previous point.
- Refer to , , or for more details.
- See .
- See .
- See or for further information.
- See or as applicable.
- See .
- Loads a TSR program into memory similar to , but after relocating the DOS data segment. Compare with INSTCDEX.
- Refer to , , or for additional context.
- See .
- See or for related commands.
- Activates console and command line history buffers with advanced pattern search capabilities.
- Defines the address for the High Memory Area (HMA) segment.
- Configures the HLT instruction for power-saving mode.
- Determines whether the system scans for boot sector viruses.
- Loads installable file system drivers.
- Prevents execution of specific subsections within CONFIG.SYS.
- Specifies programs permitted to execute at ring 2, granting direct hardware I/O access.
- Incorporates directives from another menu block, emulated via GOSUB/RETURN in DR-DOS.
- Sets the status of 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 programs post-DOS data segment relocation, similar to INSTALL.
- Adjusts PIC interrupt priorities so that a specified IRQ number receives highest priority.
KTemplate:NbndM
- Defines the keyboard layout configuration.
- Indicates the relocated address of the keyboard buffer.
- Sets the maximum number of accessible drive letters.
- Functions like LASTDRIVE but also loads the Current Directory Structure into upper memory.
- Lists paths used when searching for DLL files.
- Handles compatibility settings for legacy applications.
- Specifies the quantity of file locks allowed.
- Configures boot logo display when using PTS-DOS boot manager.
- Defines parameters such as count, order, I/O address, and timeout for LPT1 devices.
- Same as LPT1 settings but applied to LPT2 devices.
- Same as LPT1 settings but applied to LPT3 devices.
- Enables and configures LPT4 devices similarly to LPT1 through LPT3.
- Sets delay duration before increasing priority of waiting processes.
- Controls overall memory allocation approach.
- Specifies default strategy for DOS memory allocation.
- Defines options for menus within CONFIG.SYS environment.
- Sets color scheme for menus (emulatable in DR-DOS).
- Specifies which menu block is default (also emulatable in DR-DOS).
- Defines individual menu blocks (emulatable in DR-DOS).
- Enables support for multitrack disk operations.
- Continues processing CONFIG.SYS commands in a new file after loading a driver and setting the %NEWFILE% environment variable.
NTemplate:NbndQ
- Sets default response character for No () in Yes/No/Resume prompts.
- Determines whether keyboard [[Num Lock|Template:Keypress]] is enabled or disabled by default.
- Executes commands conditionally based on previous return code or error status, e.g., .
- Functions like and , displaying text and waiting for user key press.
- Requires user confirmation to acknowledge errors encountered during CONFIG.SYS processing.
- Configures buffer sizes assigned to LPT ports.
- Enables conditional execution on PC-compatible systems only.
- Adjusts scheduler priority settings within the system environment.
- Sets priorities specifically for disk I/O operations or programs.
- Changes default printer device driver assignment among LPT1 through LPT4 ports.
- Specifies whether DOS applications are permitted to execute under current conditions.
- Loads a user interface shell environment during startup.
- Allows conditional command execution on IBM PS/1-compatible machines only.
- Allows conditional command execution on IBM PS/2-compatible machines only.
- Suppresses output sent to STDOUT display.
RTemplate:NbndT
- Enables automatic system reboot upon encountering errors.
- Permits inclusion of comments within CONFIG.SYS files.
- Allocates a reserved drive letter for local block device drivers.
- Sets the default Resume () response character for Yes/No/Resume prompts.
- Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH point, optionally with a return code.
- Defines the size of real mode memory available.
- Allows simultaneous loading of programs in CONFIG.SYS, functioning similarly to CALL or INSTALL commands in DOS.
- Saves the initial character of deleted files within the FAT reserved area.
- Determines video mode settings under FreeDOS or screen access methods under PTS-DOS.
- Controls the Scroll Lock key status on the keyboard.
- Assigns environment variables.
- Loads the command interpreter shell.
- Functions like SHELL but includes a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMBs, reducing fragmentation.
- Specifies keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
- Manages file closure behavior when Ctrl+Alt+Del is pressed.
- Indicates whether POST should be bypassed during reboot.
- , STACKSIZE, STACKSHIGH
- Configure stack settings across various DOS versions and embedded systems with some compatibility details abbreviated here.
- , SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
- Directives specific to PTS-DOS that handle boot options and system memory allocation locations.
- , SUPPRESSPOPUPS, SWAPPATH
- OS/2-specific commands controlling user interface blocking, error log drive assignment, and swap file directory paths.
- , SWITCHES
- Implements conditional processing in DR DOS and Novell DOS with noted exceptions regarding PTS-DOS compatibility.
- , TRACE, TRACEBUF
- Define default system switch characters and enable single-stepping through CONFIG.SYS/AUTOEXEC.BAT with configurable logging buffer sizes under OS/2 and DOS variants.
- Additional directives manage advanced system functions including error logging (TRAPDUMP), thread control (THREADS), scheduler time slices (TIMESLICE), timeout durations (TIMEOUT), temporary file extensions (TMPEXT), and hardware workaround implementations (SXFAKEHWFPU).
UTemplate:NbndZ
- Configures DOS to utilize a designated segment as Upper Memory Block (UMB) space.
- Determines which UMB server is employed.
- Defines address ranges allocated for UMB RAM usage.
- Enables or disables verification of disk write operations.
- Sets the DOS version reported to applications.
- Manages VGA display status configurations.
- Specifies current video mode, akin to FreeDOS's SCREEN directive.
- Controls permission for virtual DMA utilization.
- Enables or disables processor Virtual Mode Extensions functionality.
- Configures VxD drivers for Windows environments.
- Establishes system support parameters for Windows operation.
- Manages relocation of the Extended BIOS Data Area (XBDA).
- Allows conditional execution on XT-compatible hardware platforms.
- Activates built-in Year 2000 compliance features.
- Sets the default affirmative character used in Yes/No prompts.
- Controls deletion tracking mechanisms.
Issues
Although booting without CONFIG.SYS or AUTOEXEC.BAT is possible, these files are critical for comprehensive DOS customization and meeting software prerequisites. File corruption necessitates diagnostic measures.
If the CONFIG.SYS lacks a SHELL directive or if it is absent or damaged, DOS attempts to locate COMMAND.COM in the root directory. Versions prior to 6.0 will fail to boot if this file is missing. MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later prompt users to specify a command interpreter path instead. This prompt also appears if the primary shell terminates unexpectedly or exits voluntarily, allowing limited runtime shell substitution without restarting.
COMMAND.COM from MS-DOS 7.0 onward is incompatible with DR-DOS and typically resides on drive C: in dual-boot configurations. DR-DOS versions 7.02 and above prevent bypassing SHELL directives during skip, trace, or step modes to avoid conflicts. Some subsequent releases introduced key commands enabling reinstatement of skip functionality for recovery from invalid SHELL parameters. When no valid SHELL is found during skipped CONFIG.SYS processing, users are prompted to specify a shell before COMMAND.COM is loaded from the root directory.
Under MS-DOS/PC DOS, CONFIG.SYS size limits range up to a few kilobytes (in recent versions up to 64 KB), whereas DR-DOS imposes no such restrictions due to its distinct parsing approach. MS-DOS compiles CONFIG.SYS into a tokenized structure stored in memory, organizing directives by type. In contrast, DR-DOS processes CONFIG.SYS line-by-line, offering granular control over loading order of drivers and TSRs via DEVICE and INSTALL commands. This method enhances conflict resolution capabilities and supports conditional execution based on hardware detection or error conditions. The INSTALL command also facilitates running non-resident software integrated within the CONFIG.SYS loading sequence.
In MS-DOS/PC DOS versions 2.0 through 4.01, the SHELL directive was limited to a maximum length of 31 characters. Later versions increased this limit up to 128 characters, while DR-DOS allows up to 255 characters. None of the CONFIG.SYS directives support long filenames.
Dual booting DOS and Windows 9x
When Windows 95 is installed over an existing DOS/Windows environment, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS to facilitate easier dual booting between DOS and Windows 9x. Selecting DOS at startup temporarily reverts these files to their original filenames. Meanwhile, backup copies of the Windows 95 versions are maintained as CONFIG.W40 and AUTOEXEC.W40.
In setups where Caldera DR-DOS 7.02/7.03 coexists with Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT files remain unaltered. DR-DOS instead utilizes DCONFIG.SYS and AUTODOS7.BAT as its initialization scripts.
OS/2 / Windows NT
OS/2 depends extensively on CONFIG.SYS for system configuration, driver loading, and environment setup prior to launching its graphical user interface.
Within the OS/2 subsystem embedded in Windows NT, the file perceived as CONFIG.SYS by OS/2 applications is actually stored within the system registry.
A variety of undocumented CONFIG.SYS commands are employed by OS/2.
CONFIG.SYS continues to play a vital role in OS/2 successors 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
- AUTOEXEC.BAT and CONFIG.SYS details – Computer Hope
- Overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS parameters
- CONFIG.SYS command guide – Caldera (partial DR-DOS 7 directives)
- Explanation of FreeDOS CONFIG.SYS instructions
- PTS-DOS 2000 Pro manual (selected CONFIG.SYS commands)
- Unofficial German PTS-DOS FAQ (includes additional CONFIG.SYS commands)