DOS/Command Prompt Reference
This page includes 100 or more command references for MS-DOS Prompt and Windows Command Prompt. Some command references have samples for the prompt and the batch files.
The list of commands by purpose, such as ‘File operations’ and ‘Text operations,’ is available here.
Popular page in this month
Command list
- To search by purpose such as ‘File operations’ and ‘Text operations,’ see: ‘List of commands by purpose’.
ABCDEFGHIJKLMNOPQRSTUVWXYZ | ||
A | ||
Adddrv | [DOS][W9x]Loads character device files into the current session. | Sample: Details:Adddrv |
---|---|---|
Append | [DOS]Configures files in the specified directory to be treated as if they exist in the current directory. | Sample: Details:Append |
Assoc | Displays or modifies file associations. | Sample: Details:Assoc |
Attrib | Displays or changes file/directory attributes. | Sample: Details:Attrib |
B | ||
Break | [DOS]Changes the configuration for handling Ctrl+C input during file access and similar operations. | Sample: Details:Break |
C | ||
Call | Executes a batch program from a batch program without terminating. Or executes subroutines. | Sample: Details:Call |
Cd | Changes the current directory. | Sample: Details:Cd, Chdir |
Chcp | Displays/changes the code page for the current session. | Sample: Details:Chcp |
Chdir | Changes the current directory. | Sample: Details:Cd, Chdir |
Chev | [DOS][W9x]Switches the language (mode) for the current session. | Sample: Details:Chev |
Chkdsk | Conducts a disk check. | Sample: Details:Chkdsk |
Chkntfs | Schedules volume check for the next startup. | Sample: Details:Chkntfs |
Choice | Displays choices on the screen and prompts for input. | Sample: Details:Choice |
Clip | Copies the provided input to the clipboard. | Sample: Details:Clip |
Cls | Clears all output in the screen. | Sample: Details:Cls |
Cmd | Executes the Windows Command Interpreter (Command Prompt). | Sample: Details:Cmd |
Color | Changes the prompt color. | Sample: Details:Color |
Command | [DOS][W9x]Executes the MS-DOS command interpreter (MS-DOS prompt). | Sample: Details:Command |
Comp | Compares files in binary. | Sample: Details:Comp |
Compact | Manages the compression status of files on NTFS. | Sample: Details:Compact |
Convert | Converts a volume with FAT/FAT32 file system to NTFS. | Sample: Details:Convert |
Copy | Copies the file(s). | Sample: Details:Copy |
Curl | Performs data transfer using URLs. | Sample: Details:Curl |
D | ||
Date | Displays and changes the system date. | Sample: Details:Date |
Del | Deletes the file(s). | Sample: Details:Del, Erase |
Deldrv | [DOS][W9x]Unloads character device files that have been loaded into the current session. | Sample: Details:Deldrv |
Deltree | [DOS][W9x]Deletes the directory tree (directory and files/directories in its directory). | Sample: Details:Deltree |
Dir | Displays the file list in the directory. | Sample: Details:Dir |
Diskcomp | Compares the (floppy) disks. | Sample: Details:Diskcomp |
Diskcopy | Copies the (floppy) disk. | Sample: Details:Diskcopy |
Doskey | Configures input assistance settings for the prompt. | Sample: Details:Doskey |
Driverquery | Outputs a comprehensive list of installed drivers on the system. | Sample: Details:Driverquery |
E | ||
Echo | Outputs text to the screen. Also toggles prompt display. | Sample: Details:Echo |
Endlocal | Ends localization of environment changes. | Sample: Details:Endlocal |
Erase | Deletes the file(s). | Sample: Details:Del, Erase |
Exit | Exits the prompt, batch programs, or subroutines. | Sample: Details:Exit |
Expand | Expands files compressed in a specific format. | Sample: Details:Expand |
F | ||
Fc | Compares files. | Sample: Details:Fc |
Find | Searches for the string from the file. | Sample: Details:Find |
Findstr | Searches for the string from the file. More advanced search options than Find are available. | Sample: Details:Findstr |
For | Executes a command for each files or texts matching with the specified pattern. | Sample: Details:For |
Forfiles | Executes a command on files/directories located under the specified directory. | Sample: Details:Forfiles |
Format | Formats a drive. | Sample: Details:Format |
Ftp | Connects to the FTP server and performs file transfers. | Sample: Details:Ftp |
Ftype | Manages the file types used in file associations. | Sample: Details:Ftype |
G | ||
Goto | Moves execution to the specified label in batch files. | Sample: Details:Goto |
H | ||
Help | Displays the command's help. | Sample: Details:Help |
Hostname | Outputs the hostname for the computer on which the Hostname program is executed to the screen. | Sample: Details:Hostname |
I | ||
Icacls | Displays or changes Access Control List (ACL). | Sample: Details:Icacls |
If | Executes a command when specified condition is met. | Sample: Details:If |
Ipconfig | Performs operations related to network adapters and IP addresses. | Sample: Details:Ipconfig |
L | ||
Label | Displays or changes the volume label of a drive. | Sample: Details:Label |
Lh | [DOS]Loads a resident program into upper memory. | Sample: Details:Lh, Loadhigh |
Loadhigh | [DOS]Loads a resident program into upper memory. | Sample: Details:Lh, Loadhigh |
M | ||
Md | Creates a new directory. | Sample: Details:Md, Mkdir |
Mem | [DOS]Outputs the memory usage status of resident programs. | Sample: Details:Mem |
Mkdir | Creates a new directory. | Sample: Details:Md, Mkdir |
Mklink | Creates a symbolic link, a hard link, etc. | Sample: Details:Mklink |
Mode | Configures devices such as CON, COMn, etc. | Sample: Details:Mode |
More command | Displays the long output per screen. | Sample: Details:More command |
Mountvol | Manages volume drive assignments. | Sample: Details:Mountvol |
Move | Moves the file(s). | Sample: Details:Move |
O | ||
Openfiles | Checks and closes open files among those shared remotely. | Sample: Details:Openfiles |
P | ||
Path | Displays or changes the path(s) to search for programs. | Sample: Details:Path |
Pause | Stops (pauses) the execution and prompts for any key input. | Sample: Details:Pause |
Ping | Sends packets to a specified host to verify network connectivity, response time, and packet loss. | Sample: Details:Ping |
Popd | Restores Pushd's directory change just before. | Sample: Details:Popd |
Prints (sends) text to the printer. | Sample: Details:Print | |
Prompt | Sets/changes the prompt display. | Sample: Details:Promt |
Pushd | Changes the current directory. The current directory can be restored by calling Popd. | Sample: Details:Pushd |
Q | ||
Qbasic | [DOS]Launches MS-DOS QBasic. | Sample: Details:Qbasic |
R | ||
Rd | Deletes the directory. | Sample: Details:Rd, Rmdir |
Recover | Attempts to recover (restore) the file. | Sample: Details:Recover |
Reg | Operates on the Windows Registry. | Sample: Details:Reg |
Rem | Does nothing. Used for writing comments in batch files. | Sample: Details:Rem |
Ren | Changes the name of the file. | Sample: Details:Ren, Rename |
Rename | Changes the name of the file. | Sample: Details:Ren, Rename |
Replace | Replaces files in a specified directory with files from another directory. | Sample: Details:Replace |
Rmdir | Deletes the directory. | Sample: Details:Rd, Rmdir |
Robocopy | Copy files and directories using the specified conditions. | Sample: Details:Robocopy |
Runas | Runs the program with a user and privileges different from the current user. | Sample: Details:Runas |
S | ||
Scandisk | [DOS][W9x]Performs a check on the disk (drive) and repair the file system. | Sample: Details:Scandisk |
Schtasks | Manages tasks, which execute programs at specific timings. | Sample: Details:Schtasks |
Set | Displays or modifies environment variables. | Sample: Details:Set |
Setlocal | Begins localization of environment changes, making environment variable changes or etc. temporary. | Sample: Details:Setlocal |
Setver | [DOS][W9x]Manages the MS-DOS version table and changes the MS-DOS version presented to a specific program. | Sample: Details:Setver |
Setx | Adds or modifies values in user-specific/system-wide environment variable settings. | Sample: Details:Setx |
Shift | Shifts parameters, specified to the batch program, and enables to use 10 or more parameters. | Sample: Details:Shift |
Shutdown | Shuts down or restarts the computer. | Sample: Details:Shutdown |
Sort | Sorts each line of input data and prints the result. | Sample: Details:Sort |
Start command | Launches the program or executes the default processing for the file. | Sample: Details:Start command |
Subst | Assigns a specific directory to a virtual drive. | Sample: Details:Subst |
Switch | [DOS]Switches the language environment of MS-DOS. | Sample: Details:Switch |
Sys | [DOS][W9x]Copies files for an MS-DOS boot disk to a drive. | Sample: Details:Sys |
Systeminfo | Displays system information. | Sample: Details:Systeminfo |
T | ||
Takeown | Sets the owner of the file/directory to the current user. | Sample: Details:Takeown |
Taskkill | Terminates the currently running program. | Sample: Details:Taskkill |
Tasklist | Displays a list of currently running programs. | Sample: Details:Tasklist |
Time | Displays and changes the system time setting. | Sample: Details:Time |
Timeout | Waits for a specified duration (waiting for input). | Sample: Details:Timeout |
Title | Changes the title of the prompt window. | Sample: Details:Title |
Tree | Displays subdirectories (or files) in the tree format. | Sample: Details:Tree |
Tskill | Forcefully terminates the running process (program). | Sample: Details:Tskill |
Type | Outputs the file content. | Sample: Details:Type |
Tzutil | Displays or changes the time zone setting. | Sample: Details:Tzutil |
V | ||
Ver | Prints the version of MS-DOS or Windows. | Sample: Details:Ver |
Verify | Sets whether to verify writing a file to a disk. | Sample: Details:Verify |
Vol | Displays the volume label and volume serial number. | Sample: Details:Vol |
W | ||
Waitfor | Sends/receives signals to wait for. | Sample: Details:Waitfor |
Where | Searches for files that match the pattern and outputs their locations. | Sample: Details:Where |
Whoami | Outputs the username, group names, and permissions based on the current session. | Sample: Details:Whoami |
X | ||
Xcopy | Copies files and directories. | Sample: Details:Xcopy |
* Command is an internal command, Command is an external command (program).
* Command is treated as an internal command only in Command Prompt and batch files running under Command Prompt environments.
* Command is treated as an internal command only in Command Prompt and batch files running under Command Prompt environments.
| | [Pipe] Passes the output of the left command as input to the right command. | Sample: Details:‘|’ |
---|---|---|
< | [Input redirection] Passes specified file contents as input to the command. | Sample: Details:‘<’ |
> | [Output redirection] Writes the output of the command to the specified file. | Sample: Details:‘>’ |
>> | [Append redirection] Appends the output of the command to the specified file. | Sample: Details:‘>>’ |
* Please see also ‘Pipe/redirection symbols’. | ||
@ | Suppresses echo-back of commands in batch files. | Sample: Details:‘@’ |
---|---|---|
: | Defines a label in batch files. | Sample: Details:‘:’ |
; | Used to write comments in Config.sys file. | Sample: Details:‘;’ |
% | Used to retrieve values of environment variables and batch program parameters. | Sample: Details:‘%’ |
! | Used for the delayed environment variable expansion. | Sample: Details:‘!’ |
^ | Treats the following character as a regular character. Or treats multiple lines as one-line command line. | Sample: Details:‘^’ |
& | Executes two or more commands in a row. | Sample: Details:‘&’ |
|| | Used to execute the another command when the command fails. | Sample: Details:‘||’ |
&& | Used to execute the another command when the command succeeds. | Sample: Details:‘&&’ |
( ) | Treats multiple commands like one command. | Sample: Details:‘( )’ |
* | Represents ‘any string of length 0 or more’ as a wildcard character. | Sample: Details:Wildcards |
? | Represents ‘any single character’ as a wildcard character. | Sample: Details:Wildcards |
CON | A device file of ‘console’. | Sample: Details:CON |
NUL | A device file of ‘an empty file’ | Sample: Details:NUL |
AUX | A device file used to communicate with the device through the default serial port. | Sample: Details:AUX, COMn |
COMn | A device file used to communicate with the device through the serial port corresponding to the specified number. | Sample: Details:AUX, COMn |
PRN | A device file used to communicate with the device (printer) through the default parallel port. | Sample: Details:PRN・LPTn |
LPTn | A device file used to communicate with the device through the parallel port corresponding to the specified number. | Sample: Details:PRN・LPTn |
COMSPEC | Contains the path to the command interpreter. | Sample: Details:COMSPEC |
---|---|---|
PATH | Contains the path(s) to search for programs when executing. | Sample: Details:Path |
PATHEXT | Contains a list of extensions to attempt when an extension is omitted. | Sample: Details:PATHEXT |
PROMPT | Contains the prompt setting. | Sample: Details:Prompt |
TEMP | Contains the path to the directory used for temporary data. | Sample: Details:TEMP, TMP |
TMP | Contains the path to the directory used for temporary data. | Sample: Details:TEMP, TMP |
Notes
- On this site, ‘Windows NT series’ means Windows NT/2000/XP or later environments or ‘cmd.exe’ environments (Not all Windows versions are researched). ‘command.com’ environment may be differ from ‘cmd.exe’ environment.
Other contents
- Using environment variables
Introduces the usage of environment variables and some of the environment variables available for use in the prompt. - About current directories
Explains what the current directory is. - Changing the drive in the prompt
Explains a method to change the current drive in the command prompt. - About batch files
Explains what a batch file is and provides information on how to create one. - Internal (built-in) commands
Explains the commands provided by MS-DOS Prompt/Command Prompt itself.