FORCE (CONFIG.SYS directive)
| Company type | Configuration file |
|---|---|
| Industry | Computer software |
| Founded | 1983 |
| Products | Configuration for DOS and OS/2 operating systems |
CONFIG.SYS serves as the central configuration file for DOS and OS/2 operating systems. This plain text file, written in ASCII, holds setup commands accessible to users that the operating system's DOS BIOS—usually found in IBMBIO.COM or IO.SYS—interprets during system startup. CONFIG.SYS was first introduced with DOS version 2.0.
Usage
The directives within CONFIG.SYS configure DOS settings related to hardware devices, software applications, and memory allocation. Once CONFIG.SYS is processed, DOS launches the command interpreter identified in the SHELL directive; if none is specified, it defaults to COMMAND.COM, which then executes AUTOEXEC.BAT.
Typically, the file consists of name=value pairs that define adjustable parameters or load specific files, predominantly device drivers and terminate-and-stay-resident programs (TSRs). In DOS environments, CONFIG.SYS is located in the root directory of the boot drive.
Certain DOS variants employ different filenames that override CONFIG.SYS:
- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, and REAL/32 utilize CCONFIG.SYS or CCONFIG.INI for configuration purposes. These systems maintain settings within a binary file named CCONFIG.BIN, which is managed through CONFIG.EXE.
- In versions of DR DOS from 3.31 onward—including PalmDOS 1.0, Novell DOS 7, and OpenDOS 7.01—DCONFIG.SYS takes precedence. This facilitates multi-boot configurations and supports disk compression drivers.
- OpenDOS 7.01 and DR-OpenDOS 7.02 additionally check for ODCONFIG.SYS, while some DR-DOS releases from 7.02 onwards look for DRCONFIG.SYS.
- Starting with DR-DOS 6.0, users can customize system file extensions using SYS /DR:ext, allowing multiple system files to coexist in the root directory and be selected by boot loaders such as LOADER.
- The SHELL command supports specifying alternative AUTOEXEC.BAT files via /P[:filename.ext], with COMMAND.COM accepting various extensions under this mode.
- DR-DOS includes a CHAIN=filespec[,label] directive that enables continuation of processing additional configuration files, which need not reside in the root directory.
- From DR-DOS 7.03 onwards, the command SYS /A copies CONFIG.SYS and AUTOEXEC.BAT alongside other system files.
Other DOS-based systems provide comparable functionality:
- FDCONFIG.SYS is used by FreeDOS - RXCONFIG.SYS is implemented in RxDOS version 7.24 and later - CONFIG.PTS is utilized by PTS-DOS
Within Windows 95 and 98—both DOS-based systems—CONFIG.SYS and AUTOEXEC.BAT files remain present but are generally left empty. Windows Me does not process CONFIG.SYS during startup; instead, it relies on environment variables stored within the registry at: HKLM\System\CurrentControlSet\Control\SessionManager\Environment
In the case of FlexOS, CONFIG.SYS exists as a binary file that specifies resource managers and device drivers loaded during boot.
Example
Below is 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>
:;*?!
- Marks labels within CONFIG.SYS that serve as jump points for , , , , and directives.
- Functions similarly to , allowing inline comments after other commands. (Note that under MS-DOS/PC DOS, inline comments enclosed in double quotes are not ignored.)
- Introduces inline commentary alongside the ; directive.
- Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS extends this with optional conditions for boot menus.) DOS versions 6.0 and above offer a comparable feature by appending after commands (e.g., ).
- Forces unconditional execution of the next directive.
ATemplate:NbndC
- Determines whether programs may be terminated upon encountering errors.
- Sets which drives record file access timestamps in FAT file systems.
- Enables conditional execution on AT-compatible hardware.
- Boot loader utility.
- Adjusts the detail level of error message output.
- Alters the default serial driver assigned to the AUX device.
- Prevents character device availability outside the phantom \DEV directory.
- Loads a fundamental device driver into memory.
- Produces a brief beep even when sound alerts are disabled.
- Indicates the operating system to boot next.
- Enables or disables extended Ctrl+C detection.
- Defines the quantity of disk buffers to allocate.
- Similar to BUFFERS but loads buffers into High Memory Area (HMA) or Upper Memory Blocks (UMB).
- Specifies the maximum number of 512-byte cache blocks allocated from the system pool.
- Sets the maximum duration before unused cache blocks return to the system pool.
- Defines the maximum interval before dirty cache blocks are written to disk.
- Loads and executes programs listed in CONFIG.SYS, running them in the foreground and pausing further processing until they complete.
- Sets Caps Lock keyboard status as either enabled or disabled.
- Identifies the CD-ROM hardware driver name.
- Specifies buffer count for CD-ROM access operations.
- Continues processing of CONFIG.SYS within a new file and optional label, available since DR-DOS 7.02.
- Defines the type of system clock used.
- Clears the display screen.
- Specifies one or more OEM codepages.
- Sets CMOS RAM address values.
- { { nobold | ( PTS - DOS only ) } }
- Defines color schemes for boot menus .
- { { mono | 1 = COM1 } } { { nobold | ( DR - DOS 7 . 02 and later ) } }
- Configures count, logical sequence, I/O address, and timeout parameters for COM1 device .
- { { mono | 1 = COM2 } } { { nobold | ( DR - DOS 7 . 02 and later ) } }
- Configures count, logical sequence, I/O address, and timeout parameters for COM2 device .
- { { mono | 1 = COM3 } } { { nobold | ( DR - DOS 7 . 02 and later ) } }
- Configures count, logical sequence, I/O address, and timeout parameters for COM3 device .
- { { mono | 1 = COM4 } } { { nobold | ( DR - DOS 7 . 02 and later ) } }
- Configures count, logical sequence, I/O address, and timeout parameters for COM4 device .
- { { mono | 1 = COMAREA } } { { nobold | ( PTS - DOS only ) } }
- Defines buffer area for DMA operations .
- { { mono | 1 = COMMENT } } { { nobold | ( DOS 4.0+ and RxDOS , ignored under DR-DOS 7.02+, Embedded DOS, PTS-DOS ) } }
- Redefines inline comment lead characters or causes subsequent line to be disregarded .
- { { mono | 1 = COUNTRY } } { { nobold | ( DOS 3.0 , DOS Plus 2.1 with FIDDLOAD , DR-DOS 3.31+, OS/2 , PTS-DOS ) } }
- Activates internationalization support .
- { { mono | 1 = CPOS } } { { nobold | ( DR-DOS 6.0+ ) } }
- Sets cursor position on configuration menus .
- { { mono | 1 = CPSW } } { { nobold | ( MS-DOS 4.00-4.01 only , ignored under DR-DOS 7.02+ ) } }
- Supports codepage switching .
- { { mono | 1 = CPU } } { { nobold | ( PTS-DOS only ) } }
- Specifies RAM refresh rate .
- { { mono CPU88} }{ { nobold | ( PTS-DOS only )} }
- Conditional execution for 8088 CPUs .
- { { mono CPU88+} }{ { nobold | ( PTS-DOS only )} }
- Conditional execution on CPUs equal or greater than 8088 .
- { { mono CPU86} }{ { nobold | ( PTS-DOS only )} }
- Conditional execution targeting 8086 CPUs .
- { { mono CPU86+} }{ { nobold | ( PTS-DOS only )} }
- Conditional execution on CPUs equal or exceeding 8086/8088 .
- { { mono CPU286} }{ { nobold | ( PTS-DOS only )} }
- Conditional execution targeting Intel 286 CPUs .
- { { mono CPU286+} }{ { nobold | ( PTS-DOS only )} }
- Conditional execution on CPUs equal or above Intel 286 .
- { { mono CPU386} }{ { nobold | ( DR-DOS 7.02+ , PTS-DOS )} }
- Conditional execution on CPUs at least Intel 386, e.g., CPU386 DEVICE=C:\DOS\EMM386.EXE or CPU386 GOTO label386 .
- { { mono CPU386+} }{ { nobold | ( PTS-DOS only )} }
- Conditional execution on CPUs equal or greater than Intel 386 .
- { { mono CPU486} }{ { nobold | ( PTS-DOS only )} }
- Conditional execution targeting Intel 486 CPUs .
- { { mono CPU486+} }{ { nobold | ( PTS-DOS only )} }
- Conditional execution on CPUs equal or exceeding Intel 486 .
DTemplate:NbndF
- Manages relocation settings for drive descriptor tables.
- Defines memory segment address for multi-sector disk data deblocking.
- Activates support for the internal debugger.
- Functions as a boot manager.
- Loads device drivers into conventional memory.
- Loads device drivers into upper memory (equivalent to in DRDOS 5.0).
- Sets country and codepage configurations for peripherals such as keyboards, screens, and LPT ports.
- Adjusts cache memory capacity.
- Determines floppy disk compatibility mode.
- Specifies the font used on display.
- Controls whether DOS loads into high or upper memory (similar to in DRDOS 5.0).
- Loads DOS tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory.
- Defines an alternative directory path for DOS files.
- Sets search paths for data files.
- Details physical parameters of disk drives.
- Establishes parameters for unknown drives.
- Refer to .
- Enables and designates drive location for PDUMP.nnn error log files.
- Outputs a message directly to the screen.
- Displays messages containing ANSI escape codes.
- Activates extra program startup verification checks.
- Assigns a default error or return code for subsequent commands.
- Specifies the A20 gate state upon program launch.
- Terminates CONFIG.SYS processing prematurely (except for SWITCHES and SHELL directives under certain conditions).
- Defines hash table size to optimize file open operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
- Sets the number of cached File Control Blocks available simultaneously (shares buffer with FILES in DR-DOS).
- Similar to FCBS but explicitly loads into upper memory.
- Acts as a boot manager.
- Specifies maximum number of simultaneously open files.
- Equivalent to FILES but explicitly loads file handles into upper memory.
- Executes specified CONFIG.SYS subsections (see IGNORE).
GTemplate:NbndI
- Waits for a keypress or timeout, setting error level to the ASCII code of the key or 1024 if timed out.
- Resumes CONFIG.SYS processing at a specified label.
- Continues nested CONFIG.SYS processing at a given label, with returning control to the previous point.
- See , , or .
- See .
- See .
- See or .
- See or .
- See .
- Installs a TSR program into memory following DOS data segment relocation. Compare INSTCDEX.
- See , , or .
- See .
- See or .
- Enables console and command line history buffer with enhanced pattern searching capabilities.
- Defines HMA segment address.
- Configures HLT-based power-saving mode.
- Specifies virus scanning of system boot sectors.
- Loads installable file system drivers.
- Prevents execution of designated CONFIG.SYS subsections; see also .
- Permits certain applications to operate at ring 2 level for direct hardware I/O access.
- Incorporates directives from another menu block (emulated by GOSUB/RETURN in DR-DOS).
- Sets keyboard Insert mode state.
- Installs TSR program into conventional memory.
- Installs TSR program into upper memory (equivalent to HIINSTALL in DR DOS 5.0).
- Installs TSR program after relocating DOS data segment (compare INSTCDEX).
- Adjusts PIC interrupt priorities to raise specified IRQ priority.
KTemplate:NbndM
- Determines the keyboard layout configuration.
- Assigns the location of the relocated keyboard buffer.
- Sets the maximum number of accessible drives.
- Functions like LASTDRIVE but loads the Current Directory Structure (CDS) into upper memory.
- Defines search directories for DLL files.
- Controls execution settings for legacy applications.
- Specifies the quantity of file locks permitted.
- Configures whether the boot logo is displayed.
- Establishes count, sequence, I/O address, and timeout parameters for the LPT1 port.
- Applies similar configuration settings to the LPT2 port.
- Configures LPT3 device parameters in a comparable manner.
- Enables and sets up the LPT4 port.
- Defines delay before raising process priority.
- Manages memory allocation methods.
- Sets default strategy for DOS memory allocation.
- Specifies menu option entries.
- Determines menu color schemes (emulatable in DR-DOS).
- Sets default menu block (supported under DR-DOS emulation).
- Defines individual menu blocks (emulatable within DR-DOS).
- Activates multitrack disk operations.
- Allows continuation of CONFIG.SYS processing in an additional file after loading a device driver and setting the %NEWFILE% environment variable.
NTemplate:NbndQ
- Defines the default 'No' character used in Yes/No/Resume prompts.
- Sets the status of the keyboard [[Num Lock|Template:Keypress]] key to on or off.
- Enables conditional command execution based on the last error code, such as .
- Displays a message and waits for a keypress, similar to and commands in DR-DOS.
- Requires user confirmation upon encountering errors in CONFIG.SYS.
- Adjusts buffer sizes for LPT1 through LPT3 ports.
- Enables conditional execution on PC-compatible systems.
- Configures scheduler priority levels.
- Sets priority for disk I/O related programs.
- Changes default printer device driver among LPT1 to LPT4 ports.
- Determines whether DOS applications are allowed to execute.
- Loads a user interface environment.
- Enables conditional execution on IBM PS/1 compatible machines.
- Facilitates conditional execution on IBM PS/2 compatible systems.
- Suppresses display output sent to STDOUT.
RTemplate:NbndT
- Activates automatic reboot upon system errors.
- Permits inclusion of comments within CONFIG.SYS files.
- Reserves a drive letter to prevent local block device assignment.
- Sets the default 'Resume' character used in prompt queries.
- Returns nested CONFIG.SYS processing control to previous GOSUB or SWITCH points with optional return codes.
- Specifies size of real mode memory allocation.
- Enables concurrent loading of programs during CONFIG.SYS processing (background mode).
- Stores deleted file's first character in FAT reserved area for recovery purposes.
- Defines video mode settings under FreeDOS or screen access methods under PTS-DOS environments.
- Controls keyboard Scroll Lock key state, turning it on or off.
- Establishes environment variable values.
- Loads the command interpreter shell program.
- Similar to SHELL but includes size parameter to pre-allocate COMMAND.COM memory, optimizing usage especially with third-party shells unable to load into HMA or UMBs.
- Specifies keyboard modifier key states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode activation.
- Determines whether files are closed when Ctrl+Alt+Del is pressed.
- Indicates if POST (Power-On Self Test) is bypassed during reboot sequences.
- , STACKSIZE, STACKSHIGH
- Configure hardware interrupt stack sizes and buffer placements depending on DOS variant used.
- , SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
- PTS-DOS specific options managing boot processes, system generation, loading procedures, and memory optimization strategies.
- , SWITCH
- Defines submenu blocks allowing nested CONFIG.SYS processing with RETURN support, mainly available from DOS 6.0 onwards.
- , SWAPPATH
- OS/2 settings controlling error logging locations and swap file directory paths.
- , SWITCHES
- Establishes default switch characters ('/' or '-') and special option flags varying by DOS version.
- , THREADS, TIMESLICE
- OS/2 exclusive configurations addressing hardware fixes, multitasking concurrency, and scheduler time slice durations.
- , TRACE, TRACEBUF
- Manage timeout intervals for single-step execution within CONFIG.SYS/AUTOEXEC.BAT scripts and configure trace log buffer sizes across different DOS platforms.
- , TRAPDUMP
- PTS-DOS option for setting temporary file extensions and OS/2 configurations related to error logging.
UTemplate:NbndZ
- Assigns a particular memory segment for use as an Upper Memory Block (UMB) in DOS.
- Designates the UMB server.
- Specifies address ranges to be treated as UMB RAM.
- Toggles disk write verification on or off.
- Provides DOS version information to applications.
- Sets parameters for VGA display status.
- Determines the active video mode.
- Activates virtual DMA capabilities.
- Manages processor Virtual Mode Extensions (VME) settings.
- Configures Windows VxD driver behavior.
- Enables support for Windows system functions.
- Controls relocation of the Extended BIOS Data Area.
- Executes commands conditionally on XT-compatible hardware.
- Sets up Year 2000 compatibility options.
- Defines the default affirmative response character in prompts.
- Monitors driver deletion events.
Issues
While the system is capable of booting without CONFIG.SYS or AUTOEXEC.BAT, these configuration files are crucial for extensive customization and meeting software startup demands. Any corruption or damage necessitates troubleshooting efforts.
If the SHELL directive is absent from CONFIG.SYS or the file itself is missing or corrupted, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Early DOS versions will fail to boot if COMMAND.COM cannot be found, whereas MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later prompt users to specify a command processor path. This prompt also appears when the command interpreter terminates unexpectedly or is intentionally exited, allowing limited shell functionality without rebooting.
Due to compatibility issues between MS-DOS 7.0+ COMMAND.COM and DR-DOS, versions 7.02 and above of DR-DOS restrict bypassing SHELL directives during skip or trace modes to prevent operational problems. If no valid shell is identified when CONFIG.SYS processing is skipped, users must provide a shell path before COMMAND.COM loads.
CONFIG.SYS file size restrictions differ: MS-DOS and PC DOS limit CONFIG.SYS to a few kilobytes (up to approximately 64 KB), whereas DR-DOS imposes virtually no limit aside from file system constraints. MS-DOS processes CONFIG.SYS by compiling it into a tokenized structure in memory, organizing directives by category (with device drivers loaded prior to TSRs). In contrast, DR-DOS parses each directive sequentially, offering precise control over load order and enabling conditional execution based on hardware detection or error conditions—features beneficial for resolving conflicts or incorporating debugging utilities.
DR-DOS includes support for launching non-resident programs through the INSTALL command, integrating temporary utilities within the CONFIG.SYS execution flow to enhance system flexibility.
Earlier MS-DOS editions restricted the SHELL command line length to 31 characters; subsequent releases expanded this limit up to 128 characters, while DR-DOS accepts lines up to 255 characters. It should be noted that CONFIG.SYS directives do not support 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, enabling dual-boot functionality between Windows 9x and DOS. During a DOS boot session, these files are temporarily restored to their standard filenames. Meanwhile, backup copies of the Windows 95 versions are saved as CONFIG.W40 and AUTOEXEC.W40.
In setups where Caldera DR-DOS 7.02 or 7.03 coexists with Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT retain their original names, whereas DR-DOS employs DCONFIG.SYS and AUTODOS7.BAT for its startup configurations.
OS/2 / Windows NT
OS/2 depends extensively on CONFIG.SYS to set up drivers and the environment prior to the graphical user interface loading. Within the OS/2 subsystem of Windows NT, although CONFIG.SYS configurations are visible to OS/2 applications, they are actually maintained within the system registry.
There are various undocumented CONFIG.SYS commands specific to OS/2. CONFIG.SYS continues to be utilized by OS/2-based systems 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) – summary of DR-DOS 7 directives
- Details on FreeDOS CONFIG.SYS directives
- User Manual for PTS-DOS 2000 Pro including CONFIG.SYS directives overview
- Unofficial German FAQ for PTS-DOS (PTS/FAQD) with supplementary CONFIG.SYS commands