Programming Field

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.

Command list

Currently only a few command references are available in English. More references are available in Japanese here: DOS/コマンドプロンプト コマンド一覧

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.
  • Commands/Programs
    CallExecutes a batch program from a batch program without terminating. Or executes subroutines.
    CdChanges the current directory.
    ChdirChanges the current directory.
    ClsClears all output in the screen.
    CopyCopies the file(s).
    DateDisplays and changes the system date.
    EchoOutputs text to the screen. Also toggles prompt display.
    EndlocalEnds localization of environment changes.
    FindSearches for the string from the file.
    MoreDisplays the long output per screen.
    MoveMoves the file(s).
    PauseStops (pauses) the execution and prompts for any key input.
    RemDoes nothing. Used for writing comments in batch files.
    SetlocalBegins localization of environment changes, making environment variable changes or etc. temporary.
    ShiftShifts parameters, specified to the batch program, and enables to use 10 or more parameters.
    TimeDisplays and changes the system time setting.
    TypeOutputs the file content.
    VerifySets 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.
    CONA device file of ‘console’.
    NULA device file of ‘an empty file’
    AUXA device file used to communicate with the device through the default serial port.
    COMnA device file used to communicate with the device through the serial port corresponding to the specified number.
    PRNA device file used to communicate with the device (printer) through the default parallel port.
    LPTnA device file used to communicate with the device through the parallel port corresponding to the specified number.