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