Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/joncampbell123/dosbox-x/llms.txt

Use this file to discover all available pages before exploring further.

The DOSBox-X DOS shell provides a comprehensive set of built-in commands that are executed directly by the shell interpreter without requiring any external executable on disk. These commands are always available regardless of which drives are mounted, making them the foundation for navigating the file system, writing batch scripts, and managing the emulated DOS environment. Commands are registered in shell_cmds.cpp and many have both a short alias and a full name (for example, CD and CHDIR are identical).
Commands implemented as built-ins live inside the shell itself and require no file on any drive. Some names that look like shell commands (CHOICE, COUNTRY, DELTREE, ADDKEY, LS, and INT2FDBG) are actually programs on the Z: drive and are documented in DOS Programs.

Change the current working directory. With no argument, print the current path.
CD <path>
CHDIR <path>
CD C:\GAMES\DOOM
CD ..
CD \
Use CD /D <drive:path> to switch drives and directories simultaneously.
Display the files and subdirectories in the current or specified directory.
DIR [path] [/W] [/P] [/A[:attrib]] [/O[:order]] [/S] [/B] [/L]
SwitchEffect
/WWide list format (multiple columns)
/PPause after each screenful
/AShow files with specified attributes (H hidden, S system, D dirs, R read-only)
/OSort order: N name, S size, E extension, D date, - reverse
/SInclude subdirectories recursively
/BBare format (filenames only)
/LLowercase output
DIR /W /P
DIR *.EXE /O:S
DIR C:\GAMES /S /B
Display directory contents in a compact Unix-style format. Supports colour-coded output and is more concise than DIR. LS is not a shell built-in — it runs as Z:\BIN\LS.COM, which is available because Z:\BIN\ is in the default DOS path.
LS [path] [options]
LS
LS C:\GAMES
Create a new directory (or a full path of nested directories).
MD <directory>
MKDIR <directory>
MD GAMES
MD C:\PROJECTS\SOURCE\UTILS
Delete an empty directory.
RD <directory>
RMDIR <directory>
The directory must be empty. Use DELTREE to remove a directory and all its contents.
Save the current directory on a stack and switch to the specified path.
PUSHD <path>
PUSHD C:\TEMP
Use POPD to return to the saved directory.
Return to the directory that was saved by the most recent PUSHD call.
POPD
Display the fully resolved path for a given file or directory, expanding subst drives and following all aliases to their real names.
TRUENAME <path>
TRUENAME E:\MYFILE.TXT

File Operations

Copy one or more files from a source to a destination. Supports wildcards and concatenation.
COPY <source> <destination> [/Y] [/-Y] [/V] [/A] [/B]
COPY GAME.EXE C:\BACKUP\
COPY *.TXT D:\DOCS\
COPY FILE1.TXT + FILE2.TXT COMBINED.TXT
SwitchEffect
/VVerify copy after writing
/YSuppress overwrite prompt
/-YRequire overwrite confirmation
/ATreat files as ASCII text
/BTreat files as binary
Delete one or more files. Wildcards are supported.
DEL <files>
ERASE <files>
DEL TEMP.TXT
DEL *.BAK
ERASE C:\OLD\*.*
There is no recycle bin in DOSBox-X. Deleted files cannot be recovered.
Recursively delete a directory and all of its files and subdirectories. DELTREE is not a shell built-in — it runs as the program Z:\DOS\DELTREE.EXE.
DELTREE <directory>
DELTREE C:\JUNK
DELTREE is destructive and irreversible. It removes all contents without prompting unless confirmation is required by the environment.
Rename a file or group of files (wildcards supported).
REN <oldname> <newname>
RENAME <oldname> <newname>
REN OLDNAME.TXT NEWNAME.TXT
REN *.BAK *.OLD
Print the contents of a text file to the console.
TYPE <file>
TYPE README.TXT
TYPE C:\CONFIG.SYS
Display a file one screen at a time, pausing between pages. Can also read from stdin via pipe.
MORE [file]
TYPE BIGFILE.TXT | MORE
View or modify file attributes. Prefix attributes with + to set or - to clear.
ATTRIB [+R|-R] [+H|-H] [+S|-S] [+A|-A] <file> [/S]
AttributeMeaning
RRead-only
HHidden
SSystem
AArchive
ATTRIB +R IMPORTANT.TXT
ATTRIB -H *.SYS
ATTRIB +R +H AUTOEXEC.BAT

Batch & Scripting

Execute a batch file as a subroutine and return to the calling batch file when it finishes.
CALL <batchfile> [arguments]
CALL SETUP.BAT
CALL C:\SCRIPTS\INIT.BAT ARG1 ARG2
Without CALL, executing another .bat from within a batch file does not return.
Print a message to the screen, or turn command echoing on or off.
ECHO [text]
ECHO [ON|OFF]
ECHO.
ECHO Hello, DOS!
ECHO OFF
ECHO.
ECHO This line is blank above
ECHO. (with a dot and no space) prints a blank line.
Iterate over a set of values and execute a command for each one. Long filename support in FOR loops is controlled by LFNFOR.
FOR %<variable> IN (<set>) DO <command>
FOR %F IN (*.TXT) DO TYPE %F
FOR %I IN (1 2 3) DO ECHO %I
Inside a batch file, use %%F (double percent) instead of %F.
Jump to the specified label within the current batch file.
GOTO <label>
GOTO END
:END
ECHO Done.
Execute a command only when a condition is true. Supports string comparison, file existence, and error-level checks.
IF [NOT] EXIST <file> <command>
IF [NOT] ERRORLEVEL <n> <command>
IF [NOT] <string1>==<string2> <command>
IF EXIST GAME.EXE GAME.EXE
IF NOT EXIST SAVE.DAT ECHO No save file found.
IF ERRORLEVEL 1 GOTO ERROR
IF "%1"=="" GOTO USAGE
Halt batch execution and display Press any key to continue... until the user presses a key.
PAUSE
Insert a comment into a batch file. The line is ignored during execution.
REM <text>
REM This batch file installs the game
REM Author: Player One
Shift the numbered batch parameters (%0, %1, …) left by one position, discarding %0 and promoting %1 to %0.
SHIFT
Display a prompt and wait for the user to press one of a defined set of keys. Sets ERRORLEVEL to the position of the chosen key. CHOICE is not a shell built-in — it runs as the program Z:\DOS\CHOICE.COM.
CHOICE [/C:<choices>] [/N] [/S] [/T:<key>,<seconds>] [text]
CHOICE /C:YN Continue?
CHOICE /C:ABC /T:A,5 Select option (A/B/C):
SwitchEffect
/C:<keys>Set of valid keys (default YN)
/NDo not show choices in prompt
/SCase-sensitive matching
/T:<key>,<secs>Default key after timeout

Environment

Display all environment variables, set a variable, or clear one.
SET
SET <variable>=<value>
SET <variable>=
SET
SET MYVAR=Hello
SET MYVAR=
SET PATH=C:\UTILS;%PATH%
A special extension SET /P <var>=<prompt> is not available in the DOSBox-X shell; use CHOICE for interactive input.
Display or set the list of directories searched for executables.
PATH
PATH <path1>[;<path2>…]
PATH ;
PATH
PATH C:\DOS;C:\UTILS;C:\GAMES
PATH ;
PATH ; clears the path to an empty string.
Customise the DOS command prompt. Special tokens are expanded when the prompt is displayed.
PROMPT [text]
TokenExpands to
$PCurrent drive and path
$G> character
$DCurrent date
$TCurrent time
$NCurrent drive letter
$$Literal $
$_Newline
PROMPT $P$G
PROMPT [$T] $P$G
Define shorthand aliases for commands or command strings.
ALIAS [name=command]
ALIAS
ALIAS LL=DIR /W
ALIAS CLS=ECHO OFF
ALIAS
Running ALIAS with no arguments displays all currently defined aliases.
Display or set the program association for a file extension. When set, running a file with that extension will automatically invoke the associated program.
ASSOC
ASSOC .<ext>
ASSOC .<ext>=<program>
ASSOC .<ext>=
ASSOC
ASSOC .TXT
ASSOC .TXT=EDIT.COM
ASSOC .TXT=
Running ASSOC with no arguments lists all current associations. Assigning an empty string (ASSOC .EXT=) removes the association.
Display the list of previously entered commands, or clear the history buffer.
HISTORY
HISTORY /C
SwitchEffect
/CClear the command history buffer
Running HISTORY with no arguments prints all previous commands in reverse chronological order.

System

Clear the console screen.
CLS
Display the current system date or set a new one.
DATE
DATE <mm-dd-yyyy>
Display the current system time or set a new one.
TIME
TIME <hh:mm:ss>
Display the current DOSBox-X version and the emulated DOS version string.
VER
Display the currently active DOS code page, or switch to a different one. Code pages control which character set is used for display and input.
CHCP
CHCP <codepage>
CHCP
CHCP 437
CHCP 850
CHCP 932
Running CHCP with no arguments displays the active code page number. Note that changing code pages is not supported in PC-98 or JEGA/AX machine modes.
Enable or disable DOS write verification. When ON, each disk write is verified by re-reading the sector.
VERIFY [ON|OFF]
VERIFY
Display the volume label and serial number of the specified drive.
VOL [drive:]
VOL
VOL C:
Control how often DOS checks for a Ctrl+C (break) keypress. When ON, checks happen more frequently (on any DOS call).
BREAK [ON|OFF]
BREAK
Redirect console I/O to a different device, such as a serial port.
CTTY <device>
CTTY COM1
CTTY CON
Exit the current shell. If DOSBox-X is running only one shell, this closes the emulator.
EXIT
Show a list of available shell commands, or display detailed help for a specific command.
HELP
HELP <command>
HELP /ALL
HELP DIR
HELP COPY
HELP /ALL
Set the country code used for locale-sensitive formatting of dates, times, and currency. COUNTRY is not a shell built-in — it runs as the program Z:\SYSTEM\COUNTRY.COM.
COUNTRY <code>
COUNTRY 44
COUNTRY 49
Insert synthetic keystrokes into the keyboard input buffer. ADDKEY is not a shell built-in — it runs as the program Z:\BIN\ADDKEY.COM.
ADDKEY <key>

Drive Management

Assign a drive letter to a directory path, making it accessible as a virtual drive.
SUBST <drive:> <path>
SUBST <drive:> /D
SUBST E: C:\GAMES\DOOM
SUBST E: /D
Toggle whether FOR loops expand to long filenames (LFN) or short 8.3 names.
LFNFOR [ON|OFF]
LFNFOR
LFNFOR ON
LFNFOR OFF
LFNFOR

Capture & Debug

Start or stop an AVI video / WAV audio capture of the current DOSBox-X session.
DX-CAPTURE
DX-CAPTURE /V
DX-CAPTURE /W
SwitchEffect
/VToggle video (AVI) capture only
/WToggle audio (WAV) capture only
Open the DOSBox-X built-in debugger, or run a program under the debugger.
DEBUGBOX
DEBUGBOX <program>
DEBUGBOX
DEBUGBOX MYAPP.EXE
Attempt to load a TSR or device driver into the upper memory area (UMA) to preserve conventional memory.
LH <program> [args]
LOADHIGH <program> [args]
LH MOUSE.EXE
LOADHIGH ANSI.SYS
Enable or disable logging of INT 2Fh (multiplex interrupt) calls. INT2FDBG is not a shell built-in — it runs as the program Z:\DEBUG\INT2FDBG.COM.
INT2FDBG [+|-]

Build docs developers (and LLMs) love