Jump to content

COUNTRY (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article COUNTRY (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryOperating systems
Founded1983
ProductsSystem configuration 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, includes setup instructions handled by the operating system's DOS BIOS—usually found in IBMBIO.COM or IO.SYS—during the boot sequence. The CONFIG.SYS file was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are responsible for configuring DOS to support hardware devices, software applications, and memory management utilities. Once CONFIG.SYS has been processed, DOS initiates the command interpreter defined by the SHELL statement; if none is specified, it defaults to COMMAND.COM, which subsequently executes AUTOEXEC.BAT.

Typically, the file consists of name=value entries that either adjust system 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 active boot drive.

The filename CONFIG.SYS is also utilized by (DCP), an MS-DOS variant developed by the former East-German company VEB Robotron.

Certain DOS derivatives check for alternative configuration filenames that supersede CONFIG.SYS:

- Advanced editions of Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 employ CCONFIG.SYS or CCONFIG.INI (in Multiuser DOS) and MCONFIG.SYS (in REAL/32). These platforms support extra configuration parameters stored in binary files like CCONFIG.BIN, which are generally managed through CONFIG.EXE.

- In versions such as DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02 and later, DCONFIG.SYS takes precedence over CONFIG.SYS to facilitate disk compression schemes and multi-boot setups. OpenDOS 7.01 and DR-OpenDOS 7.02 also recognize ODCONFIG.SYS, while some iterations of DR-DOS 7.02+ check for DRCONFIG.SYS.

- Starting with DR-DOS 6.0+, users can modify default system file extensions using SYS /DR:ext, allowing multiple system files to coexist in a single root directory selectable by boot loaders such as LOADER (used in Multiuser DOS and DR-DOS). The SHELL command supports specifying alternative AUTOEXEC.BAT files via /P[:filename.ext], and COMMAND.COM can execute files with extensions other than .BAT in this context—a feature also available in 4DOS.

- DR-DOS 6.0+ introduces the CHAIN=filespec command to continue processing from another configuration file, optionally including a label (CHAIN=filespec,label) to jump to designated sections. Additionally, DR-DOS 7.03+ offers a SYS /A option that copies CONFIG.SYS and AUTOEXEC.BAT alongside system files during installation.

Other DOS-based systems utilize comparable alternative configuration filenames: FDCONFIG.SYS in FreeDOS, RXCONFIG.SYS in RxDOS version 7.24 and above, and CONFIG.PTS in PTS-DOS.

On Windows 95 and Windows 98 boot drives, CONFIG.SYS and AUTOEXEC.BAT files are present but typically remain empty due to their legacy DOS foundation. Windows Me does not process CONFIG.SYS during startup; instead, it retrieves environment variables directly from the Windows Registry at HKLM\System\CurrentControlSet\Control\SessionManager\Environment.

In contrast, under FlexOS, CONFIG.SYS is a binary configuration file that specifies resource managers and device drivers loaded at system initialization.

Example

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, serving as jump points for , , , and commands.
Functions similarly to , but also allows inline comments following other CONFIG.SYS instructions. (Within MS-DOS/PC DOS, inline comments inside double quotes are not ignored.)
Used at the start of inline comments alongside the ; symbol.
Prompts a Yes/No confirmation before executing subsequent CONFIG.SYS commands. (FreeDOS does not support custom messages but allows conditional execution via boot menus.) DOS 6.0 and later provide a comparable feature by appending after directives, e.g., .
Forces the immediate execution of the next CONFIG.SYS command without conditions.

ATemplate:NbndC

Determines if programs can be terminated when errors occur.
Sets which drives record file access timestamps on FAT file systems.
Enables conditional command execution on AT-compatible computers.
Manages boot loading.
Adjusts the verbosity level of error messages.
Changes the default internal serial driver for AUX from COM1: through COM4:.
Prevents character devices from being accessible outside the virtual \DEV directory.
Loads a fundamental device driver into memory.
Produces a brief beep sound even if audio alerts are disabled.
Defines which operating system will boot next.
Enables or disables extended Ctrl+C checking functionality.
Specifies how many disk buffers should be allocated.
Similar to BUFFERS, but loads buffers into HMA or UMB memory areas.
, CACHETTL, CACHEFLUSH (Embedded DOS 6-XL only)
Control cache block allocation and timing of cache flushing.
Executes programs specified in CONFIG.SYS in the foreground, pausing processing until they finish.
Sets the Caps Lock state on the keyboard.
, CDDBUFFERS (PTS-DOS only)
Defines CD-ROM driver name and buffer quantity.
(DR DOS 5.0+, Embedded DOS)
Continues processing CONFIG.SYS directives from a new file or label.
, CLS, CODEPAGE (various OS-specific)
Configure system clock type, clear screen display, and specify OEM code pages respectively.
, COLOR (PTS-DOS only)
Sets CMOS RAM address and colors for boot menus.
, COM2, COM3, COM4 (DR-DOS 7.02+)
Configure count, order, I/O addresses, and timeouts for serial COM ports.
, COMMENT(s), COUNTRY
Manage DMA buffers, inline comments, and internationalization support respectively.
, CPSW (multiple DOS versions)
Control cursor positioning and codepage switching capabilities.
CPU-related directives (PTS-DOS and DR-DOS)
Conditional execution based on CPU model or generation (e.g., CPU386).

DTemplate:NbndF

Controls relocation of drive descriptor tables in memory.
Defines memory segment address used for multi-sector disk data deblocking operations.
Activates internal debugger support features.
Handles boot management tasks.
Loads device drivers into conventional memory space.
Loads device drivers into upper memory blocks (similar to in DRDOS 5.0).
Sets country code and codepage parameters for keyboard, screen, and printer devices.
Configures sizes of cache memory areas.
Determines floppy disk compatibility mode settings.
Specifies font used for display output.
Loads DOS into high memory area and/or upper memory blocks (comparable to in DRDOS 5.0).
Loads DOS internal tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory areas.
Provides an alternative search path for DOS system files.
Defines search paths for data files used by DOS.
Sets physical parameters for disk drives connected to the system.
Specifies parameters for unknown or unrecognized drives.
See .
Enables PDUMP.nnn error logging to a specified drive location.
Outputs a message to the display screen.
Outputs a message including ANSI escape sequences for formatting.
Defines additional validation checks when launching programs.
Specifies assumed error or return codes for subsequent commands.
Controls the state of the A20 gate when starting programs.
Terminates CONFIG.SYS processing early except for SWITCHES and SHELL directives under certain conditions.
Sets hash table size to speed up file opening operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
Defines how many File Control Blocks (FCBs) can be opened simultaneously (shares buffer with FILES under DR-DOS).
Similar to FCBS but loads FCBs into upper memory areas instead of conventional memory.
Boot management functionality.
Specifies maximum number of files that can be open at once by DOS processes.
Same as FILES but loads file handles into upper memory blocks instead of conventional memory.
Includes execution of specific subsections within CONFIG.SYS files (see IGNORE).

GTemplate:NbndI

Waits for a keystroke or timeout, setting the error level to the ASCII value of the key pressed or 1024 if timed out.
Resumes processing of CONFIG.SYS at the designated label.
Continues nested CONFIG.SYS processing at a specified label, then returns to the previous point.
Refer to , , or for additional details.
Refer to for further information.
Refer to for more context.
Consult or for related instructions.
Consult or for supplementary guidance.
See for related commands.
Loads a TSR program into memory following DOS data segment relocation. Compare with INSTCDEX.
Refer to , , or for related options.
Refer to for further details.
Consult or for additional information.
Activates and configures the console and command line history buffer, including extended pattern search capabilities.
Defines the address of the High Memory Area (HMA) segment.
Configures the HLT (halt) energy-saving mode.
Specifies system checks for boot sector viruses during startup.
Loads installable file system drivers.
Prevents execution of specified sections within CONFIG.SYS.
Permits designated programs to execute at CPU ring 2, enabling direct hardware I/O access.
Includes directives from another menu block (emulated using GOSUB/RETURN in DR-DOS).
Sets the status of the keyboard Insert mode.
Loads 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 (compare with INSTCDEX).
Adjusts PIC interrupt priorities to prioritize a specified IRQ number.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the address of the relocated keyboard buffer.
Sets the maximum number of accessible drives.
Functions like LASTDRIVE but also loads the Current Directory Structure into upper memory.
Lists directories used for DLL search paths.
Controls legacy program compatibility handling.
Determines the number of file locks allowed.
Configures support for boot logos during startup.
Defines parameters such as count, order, I/O address, and timeout duration for the LPT1 device.
Applies LPT1 settings similarly to LPT2 device configuration.
Applies LPT1 configuration similarly to LPT3 device settings.
Enables and configures the LPT4 parallel port device.
Sets time before a waiting process is elevated in priority by the scheduler.
Configures memory allocation strategies used by DOS.
Specifies default DOS memory allocation strategy settings.
Defines available menu options within CONFIG.SYS menus.
Sets menu color schemes (emulated through ECHO commands under DR-DOS).
Specifies default menu block behavior (emulated via TIMEOUT and SWITCH commands under DR-DOS).
Defines menu blocks (emulated using ECHO and SWITCH commands under DR-DOS).
Enables multitrack disk operations support.
Continues processing CONFIG.SYS commands from a new file after loading a driver and setting %NEWFILE% environment variable.

NTemplate:NbndQ

Sets the default character representing "No" () in Yes/No/Resume prompts.
Controls keyboard [[Num Lock|Template:Keypress]] state, turning it on or off as specified.
Executes commands conditionally based on the last return code or error status, e.g., .
Displays text and waits for a key press, similar in function to and in DR-DOS environments.
Requires user confirmation when errors occur during CONFIG.SYS processing.
Configures buffer sizes for LPT1 through LPT3 devices.
Enables conditional execution on PC-compatible systems only.
Sets scheduler priority levels for processes.
Assigns priority levels specifically for disk I/O programs.
Changes the default printer device driver assignment (e.g., switching from LPT1 to LPT3 or LPT4).
Specifies whether DOS programs are permitted to run within this environment.
Loads a user interface module during startup.
Enables conditional execution on IBM PS/1-compatible systems exclusively.
Enables conditional execution on IBM PS/2-compatible systems exclusively.
Suppresses display output directed to STDOUT.

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS (not processed by PTS-DOS).
Allocates a drive letter for local block device drivers.
Defines the default Resume () response character in Yes/No/Resume dialogs.
Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH point, optionally providing a return code.
Sets the amount of real mode memory available.
Allows simultaneous loading of programs in CONFIG.SYS in the background, functioning similarly to CALL or INSTALL commands in DOS.
Saves the initial character of deleted files within the FAT reserved area.
Determines video mode under FreeDOS or specifies screen access methods for PTS-DOS.
Controls the keyboard Scroll Lock state, turning it on or off.
Establishes environment variables.
Loads the command interpreter shell.
Functions like SHELL but includes a size parameter to relocate COMMAND.COM into HMA or UMBs, enhancing memory efficiency when using third-party shells.
Sets keyboard modifier keys such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Specifies whether files should close upon pressing Ctrl+Alt+Del.
Determines if POST is bypassed during reboot.
, STACKSIZE, STACKSHIGH
Adjust hardware interrupt stack sizes and buffer locations across different DOS versions to improve system reliability and performance where applicable.
, SYSBOOT, SYSGEN, SYSLOAD
Commands in PTS-DOS responsible for boot management, alternative operating system booting, memory address configuration, and loading systems from alternate disk sectors.
, SWAPPATH
OS/2-specific settings that define error logging drive locations and swap file paths to enhance system administration.
, SWITCHES
Facilitate conditional execution within CONFIG.SYS based on key presses or special parameters, increasing boot-time flexibility (not universally supported across all DOS variants).
, designates the default command switch character ('/' or '-'), ensuring consistent command syntax across platforms.
, TRACE
Controls timeout durations for CONFIG.SYS prompts and enables single-step debugging execution on supported systems such as DR-DOS and PTS-DOS.
Additional entries like TMPEXT, THREADS, TRAPDUMP configure temporary file extensions, concurrent thread management, and error logging respectively, tailored to specific operating system variants to optimize overall system functionality.

UTemplate:NbndZ

Sets DOS management to utilize a designated segment as Upper Memory Block (UMB) space.
Defines the UMB server configuration in use.
Specifies memory address ranges allocated as UMB RAM.
Enables or disables verification of disk write operations.
Determines the DOS version reported to applications.
Configures VGA display status settings.
Specifies the active video mode currently set.
Indicates whether virtual Direct Memory Access (DMA) usage is permitted.
Enables or disables the processor's Virtual Mode Extensions feature.
Configures VxD driver parameters for Windows environments.
Sets up system support options for Windows integration.
Manages relocation settings for the Extended BIOS Data Area (EBDA).
Allows conditional execution on XT-compatible hardware platforms.
Enables built-in Year 2000 compliance support features.
Defines the default affirmative character used in prompt responses.
Configures tracking of file deletions.

Issues

The system is capable of booting without the presence of CONFIG.SYS or AUTOEXEC.BAT; however, these files are crucial for comprehensive customization and meeting software prerequisites. If either file becomes damaged or corrupted, troubleshooting is necessary.

Should CONFIG.SYS omit the SHELL directive—or if the file itself is absent or corrupted—DOS will attempt to locate COMMAND.COM in the root directory. Versions earlier than 6.0 cannot boot without this file. Starting with MS-DOS 6.0, PC DOS 6.1, and Novell DOS 7 and later, users are prompted to specify the command processor path if COMMAND.COM is missing or terminated unexpectedly. This feature enables a limited shell replacement during runtime without requiring a system reboot.

COMMAND.COM from MS-DOS 7.0 onward is incompatible with DR-DOS, which is often used in dual-boot configurations. Beginning with DR-DOS 7.02, the operating system no longer ignores SHELL directives during skip, trace, or step modes. This improvement allows better recovery from invalid shell parameters by requesting valid shell filenames before proceeding to load COMMAND.COM.

The maximum size of CONFIG.SYS varies depending on the operating system: MS-DOS and PC DOS restrict it to a few kilobytes up to 64 KB, whereas DR-DOS does not impose a practical size limit due to its line-by-line processing method. MS-DOS converts CONFIG.SYS into a tokenized format held in memory, arranging directives so that device drivers load before terminate-and-stay-resident (TSR) programs. Conversely, DR-DOS processes each directive sequentially, granting precise control over the order in which drivers and TSRs load and enabling conditional execution based on hardware detection or error conditions. This approach facilitates advanced troubleshooting and fine-tuned system customization.

In MS-DOS and PC DOS versions 2.0 through 4.01, the SHELL directive was limited to 31 characters; subsequent releases extended this limit to 128 characters, while DR-DOS supports up to 255 characters for this directive. It is important to note that CONFIG.SYS directives do not accept long filenames.

Dual booting DOS and Windows 9x

When Windows 95 is installed over an existing DOS or Windows configuration, it renames CONFIG.SYS and AUTOEXEC.BAT to CONFIG.DOS and AUTOEXEC.DOS respectively to enable dual-boot functionality between Windows 9x and DOS environments. During a DOS boot session, these renamed files temporarily revert back to CONFIG.SYS and AUTOEXEC.BAT, while copies of the Windows 95 versions are preserved as CONFIG.W40 and AUTOEXEC.W40.

For systems running Caldera DR-DOS versions 7.02 or 7.03 alongside Windows 95, the original Windows CONFIG.SYS and AUTOEXEC.BAT files remain unaltered. Instead, DR-DOS utilizes separate startup files named DCONFIG.SYS and AUTODOS7.BAT.

OS/2 / Windows NT

OS/2 depends extensively on CONFIG.SYS for setting up device drivers and environment variables prior to launching its graphical user interface. Within the OS/2 subsystem of Windows NT, configuration data traditionally stored in CONFIG.SYS is instead maintained within the system registry.

A variety of undocumented CONFIG.SYS directives exist specifically for OS/2, reflecting its more intricate configuration requirements.

CONFIG.SYS continues to play a vital role in OS/2-based operating systems such as eComStation and ArcaOS.

See also

External links

  • AUTOEXEC.BAT and CONFIG.SYS details – Computer Hope
  • Overview of Windows 98 / MS-DOS 7.10 CONFIG.SYS directives
  • Caldera’s CONFIG.SYS Command Reference – partial list of DR-DOS 7 directives
  • FreeDOS CONFIG.SYS directive explanations
  • PTS-DOS 2000 Pro User Manual – includes PTS-DOS CONFIG.SYS commands (partial)
  • Inoffizielle deutschsprachige PTS-DOS-FAQ (PTS/FAQD) – unofficial FAQ covering additional CONFIG.SYS directives