Jump to content

CODEPAGE (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article CODEPAGE (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryOperating systems
Founded1983
Headquarters
N/A
ProductsConfiguration settings for DOS and OS/2

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 that the OS's DOS BIOS—commonly within IBMBIO.COM or IO.SYS—interprets during the system startup. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS tailor DOS to manage devices, applications, and memory allocation. Once CONFIG.SYS is processed, DOS launches the command interpreter defined by the SHELL statement, defaulting to COMMAND.COM if none is specified; this shell then executes AUTOEXEC.BAT.

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

Certain DOS variants check for alternative configuration filenames that can override CONFIG.SYS:

- Advanced editions such as Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 prioritize CCONFIG.SYS instead. Some Multiuser DOS releases utilize CCONFIG.INI, while REAL/32 opts for MCONFIG.SYS. These platforms support expanded configuration through binary files like CCONFIG.BIN, typically managed using CONFIG.EXE.

- In DR DOS 3.31 and subsequent versions including PalmDOS 1.0, Novell DOS 7, and DR-DOS 7.x, DCONFIG.SYS supersedes CONFIG.SYS. This arrangement aids multi-boot environments and disk compression setups where drive letter assignments change after compression drivers load.

- OpenDOS 7.01 and DR-OpenDOS 7.02 also look for ODCONFIG.SYS, while some DR-DOS 7.02+ editions search for DRCONFIG.SYS. The SYS /DR:ext command enables renaming system files to maintain multiple configuration profiles within a single root directory, selectable through boot loaders like LOADER found in Multiuser DOS and DR-DOS.

- DR-DOS extends the SHELL directive to allow specifying alternate AUTOEXEC.BAT files and introduces the CHAIN=filespec[,label] directive, which permits continuation of processing additional configuration files beyond the root directory.

FreeDOS employs FDCONFIG.SYS, whereas RxDOS (version 7.24 and later) uses RXCONFIG.SYS, and PTS-DOS utilizes CONFIG.PTS.

In Windows 95 and 98, which are based on DOS, CONFIG.SYS and AUTOEXEC.BAT remain in the root of the boot drive 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 FlexOS, CONFIG.SYS is a binary file listing resource managers and device drivers to be loaded during boot.

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>

:;*?!

Marks labels within CONFIG.SYS as jump points for , , , and commands.
Functions similarly but is also used for inline commentary following other directives in CONFIG.SYS. (In MS-DOS/PC DOS, inline comments are not ignored if enclosed in double quotes.)
Introduces inline comments alongside the ; directive.
Prompts the user with a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS lacks customizable messages but supports conditional boot menus defined by and .) Starting with DOS 6.0, similar functionality is available by appending after directives, e.g., .
Executes the next CONFIG.SYS directive without conditions.

ATemplate:NbndC

Determines whether programs may be terminated upon encountering errors.
Sets which drives record file access timestamps within FAT file systems.
Enables conditional execution on AT-compatible hardware.
Functions as a boot manager.
Adjusts the verbosity level of error messages.
Changes the default serial device driver from COM1: through COM4: for the AUX device.
Prevents character devices from being accessible outside the phantom \DEV directory.
Loads the fundamental device driver into memory.
Produces a brief beep even when audible alerts are turned off.
Specifies which operating system to boot next.
Enables or disables extended Ctrl+C checking.
Defines the quantity of disk buffers to allocate.
Similar to BUFFERS but loads buffers into HMA or UMB memory areas.
, CACHETTL, CACHEFLUSH (Embedded DOS 6-XL only)
Control cache block allocation timing and flushing intervals.
Loads programs listed in CONFIG.SYS, pausing further processing until they return control.
(DR-DOS 7.02+)
Sets Caps Lock keyboard status on or off.
, CDDBUFFERS (PTS-DOS only)
Designates CD-ROM driver names and buffer counts.
(DR DOS 5.0+ and Embedded DOS)
Continues CONFIG.SYS processing using a new file or label reference.
, CLS, CODEPAGE, CMOSADDR, COLOR (various OS-specific)
Configure screen clearing, OEM codepages, CMOS RAM addresses, clock types, and boot menu colors.
, COM2, COM3, COM4 (DR-DOS 7.02+)
Define serial port quantity, order, I/O port addresses, and timeout settings.
, COMMENT(S), COUNTRY (various OS versions)
Manage DMA buffer settings, redefine comment characters, or activate internationalization support.
, CPSW (MS-DOS specific)
Set cursor positioning and enable codepage switching on display.
, CPU88, CPU86, CPU286, CPU386, CPU486 variants (PTS-DOS and DR-DOS)
Allow conditional command execution based on CPU model or speed.

This group of directives illustrates essential configuration options that enhance system performance and ensure compatibility among DOS variants and derivatives, which are vital for legacy software functionality and embedded system administration.

DTemplate:NbndF

Configures the relocation of drive descriptor tables in memory.
Defines the memory segment address used for multi-sector disk data deblocking operations.
Activates internal debugger functionality.
Serves as a boot manager utility.
Loads device drivers into conventional memory space.
Loads device drivers into upper memory areas (equivalent to in DRDOS 5.0).
Sets country and codepage parameters for keyboard, screen, and printer devices.
Adjusts sizes for cache memory allocation.
Specifies compatibility mode for floppy disk drives.
Selects the font used for display output.
Controls loading of DOS into high or upper memory regions (comparable to in DRDOS 5.0).
Loads DOS internal tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory blocks.
Specifies an alternative directory path to locate DOS files.
Defines search paths for data files used by DOS applications.
Sets physical parameters for disk drives connected to the system.
Establishes configurations for unrecognized or unknown drives.
See .
Enables error logging via PDUMP.nnn files and designates the target drive for logs.
Displays a message on the screen during startup or processing.
Outputs messages incorporating ANSI escape codes for enhanced formatting.
Adds extra verification steps when starting programs.
Defines an assumed error or return code value for processing logic.
Controls the state of the A20 gate upon program initiation.
Terminates CONFIG.SYS processing early except for SWITCHES and SHELL directives which continue execution.
Sets the size of the hash table used to accelerate file opening operations (differs from MS-DOS/PC DOS FASTOPEN).
Specifies how many File Control Blocks can be cached simultaneously (shares buffer space with FILES under DR-DOS).
Similar to FCBS but loads these structures into upper memory areas.
Functions as a boot manager component.
Determines the maximum number of files that can be opened concurrently by the system.
Comparable to FILES but loads file handles into upper memory segments.
Executes specified subsections of CONFIG.SYS during processing (refer to IGNORE directive).

GTemplate:NbndI

Waits for a key press or timeout, setting the error level to the key's ASCII value or 1024 if timed out.
Resumes CONFIG.SYS processing at the indicated label.
Continues nested CONFIG.SYS processing at a specified label, then returns to the previous point.
Refer to , , or for additional information.
See also .
Consult .
Refer to or for details.
See or for more information.
Consult .
Loads a TSR program into memory following relocation of the DOS data segment.
See , , or for further details.
Consult .
Refer to or for additional context.
Activates console and command line history buffers with enhanced pattern searching capabilities.
Defines the HMA segment address.
Configures energy-saving settings related to the HLT instruction.
Specifies whether to perform a virus check on the system boot sector.
Loads installable file system drivers.
Prevents execution of designated CONFIG.SYS subsections.
Permits certain programs to operate at ring 2, allowing direct hardware I/O access.
Incorporates directives from another menu block (implemented via GOSUB/RETURN in DR-DOS).
Sets the status of keyboard Insert mode.
Installs a TSR program into memory.
Installs a TSR program into upper memory, equivalent to HIINSTALL in DR DOS 5.0.
Loads a TSR program after relocating the DOS data segment.
Adjusts PIC interrupt priorities, assigning highest priority to a specified number.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the relocated address of the keyboard buffer.
Sets the maximum number of accessible drives.
Similar to LASTDRIVE but loads the Current Directory Structure into upper memory.
Lists paths where DLLs are searched for.
Controls handling of legacy applications.
Determines the number of file locks allowed.
Configures display settings for the boot logo.
Defines count, sequence, I/O address, and timeout for LPT1 device settings.
Same configuration parameters for LPT2 device.
Same configuration parameters for LPT3 device.
Enables and configures LPT4 device parameters.
Sets delay before increasing process priority.
Configures memory allocation methods.
Specifies default strategy for DOS memory allocation.
Defines options within menus.
Specifies menu color schemes (emulatable in DR-DOS).
Sets default menu block (DR-DOS emulation supported).
Defines menu blocks (emulated under DR-DOS).
Enables multitrack disk operations support.
Continues CONFIG.SYS processing in a new file after loading a device driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Defines default "No" character used in Yes/No/Resume prompts.
Sets status of keyboard [[Num Lock|Template:Keypress]] key.
Enables conditional execution based on last error code, e.g., .
Displays text and waits for key input, similar to and commands in DR-DOS.
Requires user confirmation upon errors in CONFIG.SYS processing.
Configures buffer sizes for LPT ports.
Enables conditional execution on PC-compatible systems.
Sets scheduler priority level for processes.
Defines disk I/O priority settings for applications.
Changes default printer driver from LPT1 to LPT3 or LPT4 devices.
Restricts execution of DOS programs under certain conditions.
Loads a user interface shell environment.
Enables conditional execution on IBM PS/1-compatible machines.
Enables conditional execution on IBM PS/2-compatible machines.
Suppresses output sent to STDOUT.

RTemplate:NbndT

Activates automatic reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS.
Reserves drive letters to prevent conflicts with local block devices.
Sets the default character for Resume () prompts in Yes/No/Resume dialogs.
Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH point, optionally passing a return code.
Specifies the amount of real mode memory available.
Allows programs to load concurrently in the background within CONFIG.SYS, functioning similarly to CALL or INSTALL commands under DOS.
Preserves the initial character of deleted files in a reserved area of the FAT directory.
Defines video modes for FreeDOS or screen access methods for PTS-DOS.
Controls the status of the Scroll Lock key on the keyboard.
Sets environment variables during system initialization.
Loads the command interpreter shell.
Similar to SHELL but includes a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMBs, reducing fragmentation.
Specifies keyboard modifier key states such as Shift Lock, Num Lock, Scroll Lock, and Insert.
Determines whether files are closed automatically upon pressing Ctrl+Alt+Del.
Skips the Power-On Self-Test (POST) during reboot sequences.
, STACKSIZE, STACKSHIGH
Configure stack size parameters across various DOS versions, though some are ignored in newer DR-DOS releases.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
Commands specific to PTS-DOS that manage boot procedures, loading system files into UMBs, and alternative system file locations.
, SUPPRESSPOPUPS, SWAPPATH
OS/2-specific options controlling submenu blocks, specifying drives for error logs, and defining swap file directories.
, SWITCHES
Directives for conditional processing within CONFIG.SYS under DR DOS and Novell DOS environments.
, STRING
Defines default switch characters ('/' or '-') and internal parameters used across different DOS variants.
, THREADS, TIMESLICE
Adjustments related to OS/2 Warp fixes and configurations for scheduler threads and time slices.
, TRACE, TRACEBUF
Manage timeouts during CONFIG.SYS processing steps and enable tracing or logging features across DR-DOS, PTS-DOS, FreeDOS, and OS/2 platforms.
, TRAPDUMP
Sets temporary file extensions for PTS-DOS trap dumps and controls error logging on OS/2 systems.

UTemplate:NbndZ

Configures a specific memory segment for use as Upper Memory Block (UMB).
Specifies which UMB server is utilized by the system.
Defines address ranges designated as UMB RAM areas.
Enables or disables verification of disk writes.
Sets the DOS version number reported to applications.
Controls VGA display settings.
Indicates current video mode, analogous to FreeDOS's SCREEN command.
Determines whether virtual Direct Memory Access (DMA) is permitted.
Manages processor Virtual Mode Extensions (VME) settings.
Configures VxD drivers for Windows environments.
Adjusts system support parameters related to Windows operation.
Handles relocation of the Extended BIOS Data Area (XBDA).
Executes conditionally on XT-compatible hardware platforms.
Enables built-in Year 2000 compliance features.
Defines the default character used for Yes responses in prompts.
Configures tracking of file deletions.

Issues

Although the system is capable of booting without CONFIG.SYS or if it becomes corrupted, this file—alongside AUTOEXEC.BAT—is critical for comprehensive DOS customization and meeting software prerequisites. Repair efforts are required if either file is damaged.

When CONFIG.SYS lacks a SHELL directive or is missing/corrupted altogether, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions prior to 6.0 fail to boot without this file present. In contrast, MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later versions prompt users to specify a command processor path if COMMAND.COM cannot be found. This recovery prompt also appears if the command processor terminates unexpectedly or exits intentionally, enabling limited shell replacement during runtime without rebooting.

Because MS-DOS versions 7.0 and above use a COMMAND.COM incompatible with DR-DOS systems, DR-DOS version 7.02 and later restrict bypassing SHELL directives during skip/trace/step modes to maintain operational stability. If no SHELL directive is detected while skipping CONFIG.SYS processing, users are prompted to enter a valid shell filename prior to loading COMMAND.COM. This mechanism improves error handling during startup.

CONFIG.SYS file size limitations differ depending on the operating system. MS-DOS and PC DOS impose limits measured in kilobytes (with later versions allowing up to 64 KB), whereas DR-DOS effectively has no practical size restriction since it processes lines sequentially rather than tokenizing them. This approach grants DR-DOS enhanced flexibility in controlling driver and TSR loading order via DEVICE and INSTALL commands, facilitating resolution of conflicts and integration of non-resident software components into the boot sequence.

Earlier MS-DOS editions restrict SHELL command line length to a maximum of 31 characters, increasing up to 128 characters in later releases. DR-DOS supports command lines up to 255 characters long. It should be noted that CONFIG.SYS directives do not accept long filenames.

Dual Booting DOS and Windows 9x

When Windows 95 is installed over a pre-existing DOS/Windows environment, the system renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS respectively, enabling a dual-boot setup between Windows 9x and DOS. During a DOS boot, these files temporarily revert to their original filenames. Additionally, the Windows 95 versions are backed up as CONFIG.W40 and AUTOEXEC.W40.

If Caldera DR-DOS versions 7.02 or 7.03 are installed alongside Windows 95, the Windows CONFIG.SYS and AUTOEXEC.BAT remain unchanged, while DR-DOS employs DCONFIG.SYS and AUTODOS7.BAT for its initialization process.

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 maintained inside the system registry instead of existing as a standalone file.

OS/2 supports numerous undocumented CONFIG.SYS commands that address its intricate configuration requirements.

CONFIG.SYS continues to be utilized by OS/2-based operating systems like eComStation and ArcaOS.

See also

External links

  • Information on AUTOEXEC.BAT and CONFIG.SYS at Computer Hope
  • Overview of CONFIG.SYS directives for Windows 98 / MS-DOS 7.10 (archived)
  • Caldera's CONFIG.SYS Command Reference (archived) – summary of DR-DOS 7 directives
  • FreeDOS CONFIG.SYS directive descriptions
  • PTS-DOS 2000 Pro User Manual with CONFIG.SYS details (archived)
  • German-language unofficial PTS-DOS FAQ (PTS/FAQD) including additional CONFIG.SYS commands