Jump to content

LASTDRIVE (CONFIG.SYS directive)

From Alfawiki
CONFIG.SYS
Company typeConfiguration file
IndustryComputer software
Founded1983
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 that the system's DOS BIOS—commonly found in IBMBIO.COM or IO.SYS—interprets during the boot sequence. CONFIG.SYS was first introduced with DOS version 2.0.

Usage

The directives within CONFIG.SYS are used to configure DOS for 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.

Primarily, this file contains name=value pairs that set adjustable parameters or load device drivers and terminate-and-stay-resident (TSR) programs into memory.

In DOS environments, CONFIG.SYS is located in the root directory of the bootable drive.

Certain MS-DOS variants utilize alternative configuration filenames that take precedence over CONFIG.SYS. For instance, earlier editions of Concurrent DOS did not support CONFIG.SYS; however, subsequent releases like Concurrent DOS 386 and Multiuser DOS employ CCONFIG.SYS or CCONFIG.INI, with configuration stored in a binary file named CCONFIG.BIN, which is managed through CONFIG.EXE.

Within DR DOS versions 3.31 and later—including PalmDOS 1.0, Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02+—the file DCONFIG.SYS overrides CONFIG.SYS. This approach facilitates disk compression and multi-boot setups by allowing multiple configuration files to coexist. Additionally, OpenDOS 7.01 and DR-OpenDOS 7.02 recognize ODCONFIG.SYS, while some DR-DOS variants also check for DRCONFIG.SYS.

Starting with DR DOS 6.0, the SYS /DR:ext command enables users to modify default extensions for system and configuration files, supporting multiple boot configurations within a single root directory selectable via boot loaders such as LOADER (used in Multiuser DOS and DR-DOS). The SHELL command supports specifying alternative AUTOEXEC.BAT files using /P[:filename.ext], and COMMAND.COM can accept different file extensions in these cases—a capability also available in 4DOS.

From version 6.0 onward, DR-DOS includes support for CHAIN=filespec, which allows continuation of configuration processing from another file potentially located outside the root directory. From version 7.02+, this command optionally accepts a label parameter (CHAIN=filespec,label) to jump to a designated section within the chained file. Moreover, DR-DOS 7.03+ introduces a SYS /A option that copies CONFIG.SYS and AUTOEXEC.BAT along with other system files.

Other operating systems use similar but differently named configuration files: FreeDOS uses FDCONFIG.SYS, RxDOS employs RXCONFIG.SYS, and PTS-DOS utilizes CONFIG.PTS.

Windows 95 and Windows 98, which are built on top of DOS, include CONFIG.SYS and AUTOEXEC.BAT on their boot volumes; however, these files are usually left empty. In contrast, Windows Me does not process CONFIG.SYS during startup but instead loads environment variables directly from the Windows Registry at:

HKLM\System\CurrentControlSet\Control\SessionManager\Environment

In the case of FlexOS, CONFIG.SYS is a binary file that specifies resource managers and device drivers loaded at system initialization.

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 to serve as jump points for , , , and commands.
Functions similarly to , but additionally allows in-line comments after other CONFIG.SYS commands. Refer to . (Note that in MS-DOS/PC DOS, in-line comments inside double quotes are not ignored.)
Used at the beginning of in-line comments alongside the ; directive.
Prompts with a Yes/No confirmation before executing the next CONFIG.SYS command. FreeDOS supports optional conditions through boot menus defined by and . DOS 6.0 and later versions offer a comparable feature by appending after the directive.
Forces execution of the subsequent CONFIG.SYS command without condition.

ATemplate:NbndC

Determines whether programs can be interrupted on errors.
Sets which drives record file access timestamps on FAT systems.
Enables conditional execution specifically on AT-compatible hardware.
Boot manager functionality.
Controls the detail level of error message output.
Changes the default serial driver (COM1 to COM4) associated with the AUX device.
Prevents access to character devices outside the phantom \DEV directory.
Loads a base device driver into memory.
Produces an audible beep even if notification sounds are disabled.
Specifies which operating system to boot next.
Enables or disables extended Ctrl+C checking.
Defines how many disk buffers to allocate.
Similar to BUFFERS but loads buffers into HMA or UMB areas.
, CACHETTL, CACHEFLUSH (Embedded DOS 6-XL only)
Manage cache block allocation and timing parameters.
Executes programs within CONFIG.SYS, pausing further processing until completion.
Sets the keyboard Caps Lock state.
, CDDBUFFERS (PTS-DOS only)
Configures CD-ROM driver name and buffer settings.
Continues processing CONFIG.SYS in a new file or label section.
, CLS, CODEPAGE (various OS-specific uses)
Configure clock type, clear screen display, specify OEM code pages.
, COLOR (PTS-DOS only)
Defines CMOS RAM address and boot menu color schemes.
, COM2, COM3, COM4 (DR-DOS 7.02+)
Manages serial port count, sequence, I/O addresses, and timeout values.
, COMMENT(S), COUNTRY
Specify DMA buffer size, redefine inline-comment characters, enable internationalization support.
, CPSW
Set cursor position for menus and support codepage switching (MS-DOS versions).
CPU directives (PTS-DOS only)
Conditional execution based on CPU model or speed (CPU88, CPU386+, CPU486+, etc.).

DTemplate:NbndF

Adjusts relocation of drive descriptor tables in memory.
Defines the memory segment limit up to which multi-sector disk data deblocking is permitted.
Activates internal debugger capabilities.
Boot manager functionality.
Loads a device driver into conventional memory.
Loads a device driver into upper memory blocks (equivalent to in DRDOS 5.0).
Configures country code and code page settings for keyboard, screen, and printer devices.
Sets cache memory sizes for improved performance.
Specifies floppy disk compatibility modes.
Defines font used for display output.
Loads DOS into high memory area and/or utilizes upper memory blocks.
Loads DOS system tables such as BUFFERS, FCBS, FILES, LASTDRIVE, STACKS into upper memory areas.
Specifies an alternative directory path for DOS files.
Defines search paths for data files accessed by DOS utilities.
Sets physical parameters for disk drives.
Establishes parameters for unrecognized or unknown drives.
See .
Enables error logging with PDUMP.nnn files on specified drives.
Displays a message on the screen during boot or processing.
Displays messages including ANSI escape sequences for formatting control.
Determines whether additional checks are performed when launching programs.
Assigns an assumed error or return code for subsequent command executions.
Controls A20 gate state during program startup sequences.
Terminates CONFIG.SYS processing prematurely before reaching file end (except under certain conditions involving SWITCHES and SHELL directives).
Sets hash table size to optimize file open operations differently from MS-DOS/PC DOS FASTOPEN driver behavior.
Specifies number of cached File Control Blocks (FCBs) that can be opened simultaneously (shares buffer space with FILES under DR-DOS).
Same as FCBS but loads FCBs into upper memory regions.
Boot manager functionality continuation.
Sets maximum number of files allowed open concurrently.
Same as FILES but loads file handles into upper memory areas.
Includes execution of designated CONFIG.SYS subsections (see IGNORE).

GTemplate:NbndI

Awaits 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 additional details.
See also .
Consult .
Related commands include or .
See or for more information.
Refer to .
Loads a TSR program into memory following DOS data segment relocation. Compare with INSTCDEX.
Additional references include , , or .
See also .
Consult or for related functions.
Activates console and command line history buffer with advanced pattern search capabilities.
Defines the address of the High Memory Area (HMA) segment.
Configures the HLT CPU power-saving mode.
Sets system boot sector virus scanning options.
Loads installable file system drivers.
Prevents execution of designated CONFIG.SYS subsections.
Permits certain programs to operate at ring 2, enabling direct hardware I/O access.
Incorporates directives from another menu block (emulated by GOSUB/RETURN in DR-DOS).
Establishes keyboard Insert mode status.
Installs a TSR program into memory.
Loads TSR programs into upper memory areas (equivalent to HIINSTALL in DR DOS 5.0).
Installs TSR after relocating DOS data segment, similar in function to INSTALL.
Rotates PIC interrupt priorities, raising the priority of specified IRQ lines.

KTemplate:NbndM

Defines the keyboard layout configuration.
Specifies the relocated keyboard buffer's address.
Sets the maximum number of accessible drives.
Functions like LASTDRIVE but also loads Current Directory Structure into upper memory.
Lists directories for DLL search paths.
Manages backward compatibility with legacy applications.
Determines the number of file locks allowed.
Configures boot logo display when using PTS-DOS boot manager.
Defines count, sequence, I/O port address, and timeout settings for LPT1 device.
Provides similar configuration for LPT2 device.
Configures LPT3 device likewise.
Enables and sets parameters for LPT4 device operation.
Sets delay before increasing process priority levels.
Controls memory allocation methods.
Specifies default DOS memory allocation strategy settings.
Defines available menu options.
Sets color schemes for menus (can be emulated under DR-DOS).
Establishes default menu block (DR-DOS emulation supported).
Defines multiple menu blocks (emulatable under DR-DOS).
Enables multitrack disk access operations.
Continues CONFIG.SYS processing in a new file after loading a device driver and setting the %NEWFILE% environment variable.

NTemplate:NbndQ

Specifies the default character for No () responses in Yes/No/Resume prompts.
Toggles keyboard [[Num Lock|Template:Keypress]] state on or off at startup.
Enables conditional execution based on the last error code, e.g., .
Displays a message and waits for a key press, similar to and commands in DR-DOS.
Requires user confirmation for errors encountered during CONFIG.SYS processing.
Sets buffer sizes for LPT port operations.
Enables conditional execution on PC-compatible hardware platforms.
Adjusts scheduler priority levels for processes.
Modifies priority settings specifically for disk I/O tasks.
Changes default printer driver assignment among LPT1 through LPT4 devices.
Controls whether DOS applications are permitted to run on the system.
Loads a user interface shell environment.
Conditional execution targeting IBM PS/1-compatible systems.
Conditional execution targeting IBM PS/2-compatible systems.
Suppresses output directed to STDOUT during command execution.

RTemplate:NbndT

Activates automatic system reboot upon encountering errors.
Permits inclusion of comments within CONFIG.SYS.
Reserves a drive letter to prevent its allocation by local block devices.
Sets the default character displayed by the Resume () command in prompts.
Returns control from nested CONFIG.SYS processing to the previous GOSUB or SWITCH statement, optionally passing a return code.
Defines the size of real mode memory available.
Allows simultaneous loading of programs specified in CONFIG.SYS by running them in the background.
Retains the first character of deleted files in FAT directory entries.
Determines video mode settings for FreeDOS or screen access methods for PTS-DOS.
Configures the keyboard’s Scroll Lock status to on or off.
Establishes environment variables within the system.
Loads the command interpreter shell.
Functions like SHELL but supports a SIZE parameter to pre-allocate COMMAND.COM in HMA or UMBs, minimizing fragmentation with third-party shells.
Specifies keyboard modifier states such as Shift Lock, Num Lock, Scroll Lock, and Insert mode.
Controls whether files are closed when Ctrl+Alt+Del is pressed.
Skips the Power-On Self Test (POST) during reboot.
, STACKSIZE, STACKSHIGH, STACK (various)
Configure stack parameters across different DOS versions, with some entries ignored or serving as placeholders for compatibility purposes.
, SYSBOOT, SYSGEN, SYSLOAD, SYSTOUMB (PTS-DOS)
Manage boot manager configurations, alternative operating system boot files, memory locations, and loading DOS into Upper Memory Blocks (UMBs).
, SUBMENU (DOS variants)
Used internally or for submenu blocks with partial emulation under DR-DOS environments.
, SWAPPATH (OS/2)
Directs error logging and swap file storage paths.
, SWITCHES, SWITCHAR (multiple DOS versions)
Enable conditional processing, specify special options, and define system switch characters such as '/' or '-'.
, THREADS, TIMESLICE (OS/2)
Set hardware workaround parameters, configure concurrent thread counts, and assign scheduler time slice durations.
, TRACE, TRACEBUF (DR-DOS, PTS-DOS, OS/2)
Control CONFIG.SYS timeout settings and single-step execution with adjustable log buffer sizes.
, TRAPDUMP (Embedded DOS, OS/2)
Designate temporary file extensions and configure error logging details.

UTemplate:NbndZ

Assigns a specific memory segment for use as Upper Memory Block (UMB) space by DOS management.
Selects the UMB server to be utilized.
Defines address ranges allocated as UMB RAM areas.
Enables or disables verification of disk writes.
Specifies the DOS version reported to applications.
Configures VGA display status parameters.
Sets the active video mode.
Determines whether virtual DMA functionality is permitted.
Controls deactivation of processor Virtual Mode Extensions.
Configures VxD driver settings for Windows environments.
Adjusts system support options for Windows operation.
Manages relocation of the Extended BIOS Data Area (EBDA).
Executes conditionally only on XT-compatible hardware platforms.
Enables built-in Year 2000 compliance support features.
Specifies default affirmative response character for prompts.
Controls tracking of file deletions.

Issues

While the system can initiate booting without CONFIG.SYS or AUTOEXEC.BAT present, these configuration files remain critical for comprehensive DOS customization and fulfilling software dependencies. Corruption or loss of these files necessitates troubleshooting interventions.

In cases where CONFIG.SYS lacks a SHELL directive or if it is missing or damaged, DOS attempts to locate COMMAND.COM in the root directory of the boot drive. Earlier MS-DOS releases prior to version 6.0 fail to boot without this file. However, MS-DOS 6.0/PC DOS 6.1 and Novell DOS 7 and later versions prompt users to input a command processor path. This recovery prompt also appears if the primary command interpreter terminates unexpectedly or exits intentionally, enabling limited shell replacement at runtime without requiring a reboot.

Due to incompatibilities between MS-DOS 7.0+ COMMAND.COM and DR-DOS implementations, DR-DOS versions from 7.02 onward restrict bypassing SHELL directives during skip/trace/step modes to avoid errors. When no SHELL directive is found during skip processing, users must provide a valid shell filename before COMMAND.COM loads. If left blank, default values are applied.

CONFIG.SYS file size limitations differ among DOS variants: MS-DOS/PC DOS generally restricts CONFIG.SYS size to a maximum of 64 KB in recent editions, whereas DR-DOS imposes no specific limit beyond underlying file system constraints. MS-DOS converts CONFIG.SYS into tokenized memory structures during processing to enforce device drivers loading prior to TSRs. Conversely, DR-DOS interprets directives sequentially line-by-line, granting precise control over load order through DEVICE and INSTALL commands. This approach resolves conflicts related to load sequencing and supports conditional execution based on detected hardware or error conditions—enhancing user control and facilitating integration of temporary utilities.

Earlier MS-DOS iterations restricted SHELL command line length to 31 characters, later extended up to 128 characters. DR-DOS accepts lines up to 255 characters in length. It should be noted that CONFIG.SYS directives do not accommodate long filenames.

Dual boot configuration for DOS and Windows 9x

When Windows 95 is installed over a pre-existing DOS/Windows environment, the files CONFIG.SYS and AUTOEXEC.BAT are renamed to CONFIG.DOS and AUTOEXEC.DOS to enable dual boot functionality between Windows 9x and DOS. During a DOS startup, these files are temporarily reverted to their original names, CONFIG.SYS and AUTOEXEC.BAT. Meanwhile, backup copies of the Windows 95-specific versions are stored as CONFIG.W40 and AUTOEXEC.W40.

In setups where Caldera DR-DOS 7.02/7.03 coexists with Windows 95, the CONFIG.SYS and AUTOEXEC.BAT files for Windows retain their standard names. DR-DOS, however, employs DCONFIG.SYS and AUTODOS7.BAT as its initialization scripts.

OS/2 and Windows NT

OS/2 makes extensive use of CONFIG.SYS to load drivers and set environment parameters before its graphical interface initializes.

Within the OS/2 subsystem embedded in Windows NT, the CONFIG.SYS file perceived by OS/2 programs is actually maintained within the system registry.

OS/2 utilizes a variety of undocumented CONFIG.SYS commands.

CONFIG.SYS continues to be used by OS/2-based operating systems such as eComStation and ArcaOS.

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
  • Guide to FreeDOS CONFIG.SYS directives
  • User Manual for PTS-DOS 2000 Pro including CONFIG.SYS directives (archived)
  • Unofficial German FAQ for PTS-DOS covering CONFIG.SYS directives (archived)