Jump to content

GOTO (CONFIG.SYS directive)

From Alfawiki
Adapted from the English Wikipedia article GOTO (CONFIG.SYS directive), available under CC BY-SA 4.0Updated 9 August 2025
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983 (with DOS version 2.0)
ProductsSystem configuration for DOS and OS/2

CONFIG.SYS serves as the main configuration file for DOS and OS/2 operating systems. This particular ASCII text document holds setup instructions accessible to users, which are interpreted by the operating system's DOS BIOS—commonly found in IBMBIO.COM or IO.SYS—during system startup. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are responsible for setting up DOS to manage hardware devices, software applications, and memory allocation. Once CONFIG.SYS has been processed, DOS initiates the command interpreter specified by the SHELL directive, defaulting to COMMAND.COM if none is provided; this shell then executes the commands in AUTOEXEC.BAT.

Typically, the file comprises name=value statements that adjust configuration parameters or load components such as device drivers and terminate-and-stay-resident programs (TSRs). In DOS environments, CONFIG.SYS is located in the root directory of the bootable drive.

The same filename is also utilized by (DCP), an MS-DOS variant developed by East-German manufacturer VEB Robotron.

Certain DOS versions prioritize alternative filenames over CONFIG.SYS:

Early releases of Concurrent DOS from versions 3.2 through 4.1 lacked support for CONFIG.SYS; however, subsequent editions like Concurrent DOS 386, Concurrent DOS XM, Multiuser DOS, System Manager, and REAL/32 look for CCONFIG.SYS (derived from "Concurrent"). Some Multiuser DOS variants employ CCONFIG.INI, while REAL/32 may reference MCONFIG.SYS. These platforms accommodate extended configuration data stored in binary form as CCONFIG.BIN, typically edited using CONFIG.EXE.

In the case of DR DOS 3.31, PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS versions 7.02 and later, a file named DCONFIG.SYS takes precedence over CONFIG.SYS. This originated from disk compression utilities that alter drive letter assignments after booting and also facilitates multi-boot configurations.

Additionally, OpenDOS 7.01 and DR-OpenDOS 7.02 check for ODCONFIG.SYS, while some DR-DOS 7.02+ builds look for DRCONFIG.SYS. Since DR DOS 6.0, the command SYS /DR:ext allows renaming of system and configuration files to enable multiple boot environments within a single root directory, selectable via boot loaders such as LOADER included with Multiuser DOS and DR-DOS 7.x.

The SHELL directive permits specifying alternative AUTOEXEC.BAT files using /P[:filename.ext], with COMMAND.COM accepting extensions other than ".BAT" in this mode—a feature also supported by 4DOS. Starting with DR-DOS 6.0, a CHAIN=filespec directive enables continuation of processing another configuration file located outside the root directory; DR-DOS 7.02+ extends this with an optional label argument for targeted execution.

From DR-DOS 7.03 onward, the command SYS /A allows copying CONFIG.SYS and AUTOEXEC.BAT alongside system files during installation.

FreeDOS provides a comparable mechanism via FDCONFIG.SYS; RxDOS version 7.24 and above uses RXCONFIG.SYS; while PTS-DOS employs CONFIG.PTS.

Both CONFIG.SYS and AUTOEXEC.BAT exist in the root directory of boot drives on Windows 95 and Windows 98, though these are generally empty due to their reliance on underlying DOS architecture.

Windows Me does not process CONFIG.SYS during startup; instead, it loads environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

In contrast, under the FlexOS operating system, CONFIG.SYS is a binary file that specifies resource managers along with device drivers.

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 that serve as jump destinations for , , , , and commands.
Functions similarly to , also utilized for inline comments following other CONFIG.SYS instructions. (Note: MS-DOS/PC DOS does not ignore inline comments enclosed in double quotes.)
Used at the start of inline comments alongside the ; directive.
Prompts a Yes/No confirmation with an optional message before executing subsequent CONFIG.SYS commands. (FreeDOS supports boot menu conditions but lacks optional messages.)
Forces the immediate execution of the next CONFIG.SYS command.

ATemplate:NbndC

Determines whether programs can be interrupted upon errors.
Sets which drives record file access timestamps in FAT file systems.
Executes conditionally on AT-compatible hardware.
Acts as a boot management utility.
Controls the level of detail in error messages.
Changes the default serial driver assigned to the AUX device.
Prevents access to character devices outside the phantom \DEV directory.
Loads a fundamental device driver into memory.
Produces a brief beep even if sound notifications are disabled.
Indicates which operating system to boot next.
Enables or disables extended Ctrl+C interrupt checking.
Specifies how many disk buffers to allocate.
Similar to BUFFERS but loads them into HMA or UMB memory areas.
Defines the maximum number of cache blocks dynamically allocated from the system memory pool.
Sets the maximum idle time before unused cache blocks are returned to the system pool.
Determines how long before dirty cache blocks are flushed to disk.
Loads and executes programs within CONFIG.SYS in the foreground, pausing further processing until completion.
Configures the keyboard Caps Lock state (on or off).
Specifies the driver name for CD-ROM hardware.
Sets the number of buffers used for CD-ROM access.
Continues processing CONFIG.SYS directives in a separate file and label (available since DR-DOS 7.02).
Defines the type of system clock used.
Clears the display screen.
Specifies one or more OEM codepages.
Indicates CMOS RAM address location.
{ { nobold | ( PTS - DOS only ) } }
Defines color schemes for boot menus .
;{ { anchor | COM1 } } { { mono | 1 = COM1 } } { { nobold | ( DR - DOS 7 . 02 + ) } }: Sets count, order, I/O port, and timeout parameters for COM1 device .
;{ { anchor | COM2 } } { { mono | 1 = COM2 } } { { nobold | ( DR - DOS 7 . 02 + ) } }: Configures count, sequence, I/O address, and timeout for COM2 device .
;{ { anchor | COM3 } } { { mono | 1 = COM3 } } { { nobold | ( DR - DOS 7 . 02 + ) } }: Specifies count, order, I/O port, and timeout values for COM3 device .
;{ { anchor | COM4 } } { { mono | 1 = COM4 } } { { nobold | ( DR - DOS 7 . 02 + ) } }: Defines count, sequence, I/O address, and timeout for COM4 device .
;{ { anchor | COMAREA } } { { mono | 1 = COMAREA } } { { nobold | ( PTS - DOS only ) } }: Assigns buffer area for DMA operations .
;{ { anchor | COMMENT | COMMENTS } } { { mono | 1 = COMMENT } } { { nobold | ( DOS 4 .0 + RxDOS , ignored under DR - DOS 7 .02 + , Embedded DOS , PTS - DOS )} }: Reassigns lead characters for inline comments or causes subsequent line to be disregarded .
;{ { anchor | COUNTRY } } { { mono | 1 = COUNTRY } } { { nobold | ( DOS 3 .0 , DOS Plus 2 .1 with FIDDLOAD , DR - DOS 3 .31 + , OS /2 , PTS - DOS )} }: Activates and configures internationalization support .
;{ { anchor | CPOS } } { { mono | 1 = CPOS } } { { nobold | ( DR - DOS 6 .0 + )} }: Positions cursor display in configuration menus .
;{ { anchor | CPSW} }{ { mono | CPSW} }{ { nobold | ( MS - DOS4 .00 -4 .01 only , ignored under DR - DOS7 .02 +) }}: Supports codepage switching .
;{ { anchor | CPU} }{ { mono | CPU} }{ { nobold | ( PTS - DOS only) }}: Sets RAM refresh speed parameters .
;{ { anchor | CPU88} },{ { CPU88+} },{ { CPU86} },{ { CPU86+} },{ { CPU286} },{ { CPU286+} },{ { CPU386} },{ { CPU386+} },{ { CPU486} },{ { CPU486+} }: Directives for conditional execution based on specific CPU models (PTS - DOS and DR - DOS).

DTemplate:NbndF

Manages the relocation of drive descriptor tables.
Defines the memory segment limit for multi-sector disk data deblocking.
Activates support for the internal debugger.
Functions as a boot manager.
Loads a device driver into conventional memory.
Loads a device driver into upper memory, corresponding to in DRDOS 5.0.
Sets country and codepage configurations for KBD, SCR, and LPT devices.
Configures the sizes of cache memory.
Determines floppy disk compatibility mode.
Selects the display font.
Controls loading DOS into high memory and utilization of upper memory, similar to in DRDOS 5.0.
Loads DOS tables (BUFFERS, FCBS, FILES, LASTDRIVE, STACKS) into upper memory.
Defines an alternate search path for DOS files.
Specifies the search path for data files.
Sets physical disk drive parameters.
Defines parameters for drives not recognized by the system.
Refer to .
Enables error logging with PDUMP.nnn and specifies target drive.
Outputs a message on screen.
Displays a message including ANSI escape sequences.
Determines whether additional program startup checks occur.
Sets an assumed error or return code for subsequent operations.
Configures the A20 gate state on program startup.
Terminates CONFIG.SYS processing early except for SWITCHES and SHELL directives under certain conditions.
Defines hash table size for accelerated file open operations, differing from MS-DOS/PC DOS FASTOPEN driver behavior.
Specifies number of cached File Control Blocks open simultaneously (shares buffer with FILES under DR-DOS).
Similar to FCBS but loads FCBs into upper memory.
Acts as a boot manager.
Sets maximum number of files that can be opened concurrently.
Same as FILES but loads file handles into upper memory.
Includes execution of designated CONFIG.SYS subsections (see IGNORE).

GTemplate:NbndI

Waits for a key press or timeout, setting error level to ASCII code or 1024 if timed out.
Resumes CONFIG.SYS processing at a specified label.
Continues nested CONFIG.SYS processing at a label, with returning control to prior location.
Refer to , , or .
Refer to .
Refer to .
See or .
See or .
Consult .
Installs a TSR program into memory similar to , after relocating DOS data segment.
See , , or .
See .
See or .
Enables console and command line history buffer with enhanced pattern searching capabilities.
Specifies the address of the HMA segment.
Configures HLT energy-saving mode settings.
Defines system boot sector virus scan parameters.
Loads installable file system drivers.
Excludes execution of specified CONFIG.SYS subsections from processing.
Permits certain programs to operate at ring 2 privilege level for direct hardware I/O access.
Includes directives from another menu block (can be emulated with GOSUB/RETURN in DR-DOS).
Sets keyboard Insert mode status flag.
Installs a TSR program into conventional memory.
Installs TSR into upper memory (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSR after relocation of DOS data segment.
Rotates PIC interrupt priorities to assign highest priority to specified IRQ number.

KTemplate:NbndM

Defines the keyboard layout configuration.
Indicates the location of the relocated keyboard buffer.
Determines the maximum number of accessible drives.
Functions like LASTDRIVE but loads the Current Directory Structure (CDS) into upper memory.
Specifies the search paths for DLL files.
Handles compatibility settings for legacy software.
Sets the quantity of file locks permitted.
Controls the display of the boot logo during system startup.
Configures the count, sequence, I/O port address, and timeout for the LPT1 device.
Configures the count, sequence, I/O port address, and timeout for the LPT2 device.
Configures the count, sequence, I/O port address, and timeout for the LPT3 device.
Enables and sets parameters for LPT4 similarly to other LPT devices.
Defines wait duration before increasing process priority.
Specifies how memory allocation is managed.
Sets the default DOS memory allocation approach.
Outlines menu option configurations.
Determines menu color schemes (emulatable under DR-DOS).
Establishes default menu blocks (emulatable under DR-DOS).
Defines individual menu blocks (emulatable under DR-DOS).
Activates multitrack disk operations.
Continues processing CONFIG.SYS from a new file after loading a driver and setting the %NEWFILE% environment variable.

NTemplate:NbndQ

Sets the default No () response character in Yes/No/Resume prompts.
Controls whether Num Lock is enabled or disabled on startup.
Allows conditional execution based on the last error code, for instance .
Displays a message and waits for a keypress, similar to DR-DOS's and commands.
Requires user confirmation for errors encountered in CONFIG.SYS.
Adjusts buffer sizes for LPT1 through LPT3 ports.
Enables conditional execution on PC-compatible systems.
Configures scheduler priority levels.
Assigns priority to disk I/O related programs.
Changes the default printer device driver among LPT1 to LPT4 options.
Controls whether DOS applications are permitted to run.
Loads a user interface shell environment.
Enables conditional execution on IBM PS/1-compatible hardware.
Enables conditional execution on IBM PS/2-compatible hardware.
Suppresses output sent to STDOUT.

RTemplate:NbndT

Activates automatic system reboot upon errors.
Permits inclusion of comments within CONFIG.SYS files.
Reserves drive letters assigned by local block device drivers.
Specifies default Resume () character in Yes/No/Resume prompts.
Returns control from nested CONFIG.SYS processing to previous GOSUB or SWITCH points with optional return codes.
Defines size of real mode memory available.
Allows concurrent loading of programs within CONFIG.SYS, similar to CALL or INSTALL commands under DOS.
Determines whether deleted files’ first character is stored in FAT reserved areas.
Specifies video mode in FreeDOS or screen access methods in PTS-DOS environments.
Sets Scroll Lock status on or off during startup.
Defines environment variables settings.
Loads command interpreter shell executable.
Similar to SHELL but permits specifying size when relocating COMMAND.COM into HMA or UMBs, optimizing memory use with third-party shells.
Sets keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode at startup.
Controls if files are closed during Ctrl+Alt+Del initiated reboot sequences.
Skips Power-On Self-Test (POST) procedures during reboot cycles.
, STACKSIZE, STACKSHIGH
Configure hardware interrupt stack sizes and buffer locations across various DOS versions to enhance system stability and optimize memory usage.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB
PTS-DOS-specific directives that manage boot operations, memory allocation strategies, and loading of system components from alternative sources or upper memory blocks to improve performance.
, SWITCH
Enables conditional nested processing within CONFIG.SYS along with submenu blocks to simplify configuration workflows in DOS variants excluding DR-DOS and FreeDOS.
, SWAPPATH
OS/2 directives that manage error log destinations and swap file locations for better system administration.
, SWITCHES
Define default command-line switch characters ('/' or '-') and special options to tailor system behavior across different DOS platforms.
, THREADS, TIMESLICE
OS/2 configurations addressing hardware floating-point unit issues, thread concurrency management, and scheduler time slicing to enhance multitasking capabilities.
, TRACE, TRACEBUF
Control timeouts for CONFIG.SYS commands and enable detailed single-step execution logging across DR-DOS, PTS-DOS, FreeDOS, and OS/2 systems for troubleshooting and optimization purposes.
, TRAPDUMP
Specifies temporary file extensions (PTS-DOS) and activates comprehensive error logging (OS/2) to support diagnostic processes.

UTemplate:NbndZ

Directs DOS to allocate a particular segment as Upper Memory Block (UMB) space.
Determines which UMB server is utilized.
Defines memory address ranges designated for UMB RAM.
Controls the activation of disk write verification.
Sets the DOS version number reported to applications.
Manages VGA display settings.
Indicates the active video mode.
Specifies whether virtual DMA functionality is permitted.
Determines if the processor’s Virtual Mode Extensions are disabled.
Configures the VxD driver used in Windows environments.
Establishes system compatibility features for Windows.
Sets parameters for relocating the Extended BIOS Data Area (XBDA).
Enables conditional commands on XT-compatible hardware.
Activates built-in support for Year 2000 compliance.
Defines the default affirmative character in prompt responses.
Manages tracking of file deletions.

Issues

Although the system can start without CONFIG.SYS or AUTOEXEC.BAT, these configuration files are critical for comprehensive OS customization and meeting software prerequisites. Any corruption or damage necessitates diagnostic intervention.

If CONFIG.SYS does not include a SHELL command—or if it is missing or corrupted—DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Versions earlier than 6.0 will fail if COMMAND.COM is absent, whereas MS-DOS 6.0, PC DOS 6.1, Novell DOS 7 and later versions prompt the user to specify a command interpreter path. This prompt also appears if the command processor terminates unexpectedly or exits intentionally, providing an opportunity to substitute a runtime shell without rebooting.

COMMAND.COM from MS-DOS 7 and later is incompatible with DR-DOS, which impacts dual-boot configurations where COMMAND.COM resides in C:\. Starting with DR-DOS 7.02, bypassing SHELL directives during skip, trace, or step modes is restricted to prevent issues with invalid shells. Users are prompted to enter valid shell filenames before COMMAND.COM loads from the root directory.

The maximum size of CONFIG.SYS varies by operating system: MS-DOS and PC DOS limit it to several kilobytes up to a maximum of 64 KB in newer releases, while DR-DOS imposes no significant size restriction due to its line-by-line parsing approach rather than tokenization. This allows DR-DOS users enhanced flexibility in managing driver and TSR loading sequences through DEVICE and INSTALL commands, enabling resolution of conflicts and integration of temporary utilities into the boot process.

Earlier MS-DOS versions restrict the SHELL command line length to 31 characters; subsequent versions extend this limit up to 128 characters, and DR-DOS supports up to 255 characters. It should be noted that CONFIG.SYS directives do not support long filenames.

Dual booting DOS and Windows 9x

During installation of Windows 95 over an existing DOS/Windows environment, the original CONFIG.SYS and AUTOEXEC.BAT files are renamed as CONFIG.DOS and AUTOEXEC.DOS respectively to enable dual-boot functionality. When booting into DOS mode, these files are temporarily restored under their original names. Backup copies corresponding to Windows 95 are saved as CONFIG.W40 and AUTOEXEC.W40.

In systems where Caldera DR-DOS versions 7.02 or 7.03 coexist with Windows 95, Windows’ CONFIG.SYS and AUTOEXEC.BAT remain unchanged. Instead, DR-DOS utilizes DCONFIG.SYS and AUTODOS7.BAT as its startup configuration files.

OS/2 / Windows NT

OS/2 makes extensive use of CONFIG.SYS for driver setup and environment configuration prior to launching its graphical interface.

Within the OS/2 subsystem integrated into Windows NT, CONFIG.SYS parameters are maintained within the system registry rather than traditional configuration files.

Numerous CONFIG.SYS instructions applicable to OS/2 remain undocumented.

The OS/2 derivatives eComStation and ArcaOS continue to rely on CONFIG.SYS for system configuration.

See also

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
  • Explanation of FreeDOS CONFIG.SYS directives
  • PTS-DOS 2000 Pro User Guide featuring CONFIG.SYS directives (archived)
  • Unofficial German PTS-DOS FAQ (archived) – includes details on CONFIG.SYS directives