DOS/Command Prompt Reference
This page includes command references for MS-DOS Prompt and Windows Command Prompt. Some command references have samples for the prompt and the batch files.
Currently only a few command references are available in English. More references are available in Japanese here: DOS/コマンドプロンプト コマンド一覧
- 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.
Call Executes a batch program from a batch program without terminating. Or executes subroutines. Cd Changes the current directory. Chdir Changes the current directory. Cls Clears all output in the screen. Copy Copies the file(s). Date Displays and changes the system date. Echo Outputs text to the screen. Also toggles prompt display. Endlocal Ends localization of environment changes. Find Searches for the string from the file. More Displays the long output per screen. Move Moves the file(s). Pause Stops (pauses) the execution and prompts for any key input. Rem Does nothing. Used for writing comments in batch files. Setlocal Begins localization of environment changes, making environment variable changes or etc. temporary. Shift Shifts parameters, specified to the batch program, and enables to use 10 or more parameters. Time Displays and changes the system time setting. Type Outputs the file content. Verify Sets whether to verify writing a file to a disk.* 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.
- Pipe/Redirection symbols
| [Pipe] Passes the output of the left command as input to the right command. < [Input redirection] Passes specified file contents as input to the command. > [Output redirection] Writes the output of the command to the specified file. >> [Append redirection] Appends the output of the command to the speicified file.
- Special characters / Device file name etc.
@ Suppresses echo-back of commands in batch files. : Defines a label in batch files. ; Used to write comments in Config.sys file. % Used to retrieve values of environment variables and batch program parameters. ^ Treats the following character as a regular character. Or treats multiple lines as one-line command line. & Executes two or more commands in a row. CON A device file of ‘console’. NUL A device file of ‘an empty file’ AUX A device file used to communicate with the device through the default serial port. COMn A device file used to communicate with the device through the serial port corresponding to the specified number. PRN A device file used to communicate with the device (printer) through the default parallel port. LPTn A device file used to communicate with the device through the parallel port corresponding to the specified number.