Programming Field

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.

Command list

  • Commands/Programs
    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.
    AssocDisplays or modifies file associations.
    AttribDisplays or changes file/directory attributes.
    Break[DOS]Changes the configuration for handling Ctrl+C input during file access and similar operations.
    CallExecutes a batch program from a batch program without terminating. Or executes subroutines.
    CdChanges the current directory.
    ChcpDisplays/changes the code page for the current session.
    ChdirChanges the current directory.
    Chev[DOS][W9x]Switches the language (mode) for the current session.
    ChkdskConducts a disk check.
    ChkntfsSchedules volume check for the next startup.
    ChoiceDisplays choices on the screen and prompts for input.
    ClipCopies the provided input to the clipboard.
    ClsClears all output in the screen.
    CmdExecutes the Windows Command Interpreter (Command Prompt).
    ColorChanges the prompt color.
    Command[DOS][W9x]Executes the MS-DOS command interpreter (MS-DOS prompt).
    CompCompares files in binary.
    CompactManages the compression status of files on NTFS.
    ConvertConverts a volume with FAT/FAT32 file system to NTFS.
    CopyCopies the file(s).
    CurlPerforms data transfer using URLs.
    DateDisplays and changes the system date.
    DelDeletes 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).
    DirDisplays the file list in the directory.
    DiskcompCompares the (floppy) disks.
    DiskcopyCopies the (floppy) disk.
    DoskeyConfigures input assistance settings for the prompt.
    EchoOutputs text to the screen. Also toggles prompt display.
    EndlocalEnds localization of environment changes.
    EraseDeletes the file(s).
    ExitExits the prompt, batch programs, or subroutines.
    ExpandExpands files compressed in a specific format.
    FcCompares files.
    FindSearches for the string from the file.
    FindstrSearches for the string from the file. More advanced search options than Find are available.
    ForExecutes a command for each files or texts matching with the specified pattern.
    ForfilesExecutes a command on files/directories located under the specified directory.
    FormatFormats a drive.
    FtpConnects to the FTP server and performs file transfers.
    FtypeManages the file types used in file associations.
    GotoMoves execution to the specified label in batch files.
    HelpDisplays the command's help.
    HostnameOutputs the hostname for the computer on which the Hostname program is executed to the screen.
    IcaclsDisplays or changes Access Control List (ACL).
    IfExecutes a command when specified condition is met.
    IpconfigPerforms operations related to network adapters and IP addresses.
    LabelDisplays 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.
    MdCreates a new directory.
    Mem[DOS]Outputs the memory usage status of resident programs.
    MkdirCreates a new directory.
    MklinkCreates a symbolic link, a hard link, etc.
    ModeConfigures devices such as CON, COMn, etc.
    More commandDisplays the long output per screen.
    MountvolManages volume drive assignments.
    MoveMoves the file(s).
    OpenfilesChecks and closes open files among those shared remotely.
    PathDisplays or changes the path(s) to search for programs.
    PauseStops (pauses) the execution and prompts for any key input.
    PopdRestores Pushd's directory change just before.
    PrintPrints (sends) text to the printer.
    PromptSets/changes the prompt display.
    PushdChanges the current directory. The current directory can be restored by calling Popd.
    Qbasic[DOS]Launches MS-DOS QBasic.
    RdDeletes the directory.
    RecoverAttempts to recover (restore) the file.
    RegOperates on the Windows Registry.
    RemDoes nothing. Used for writing comments in batch files.
    RenChanges the name of the file.
    RenameChanges the name of the file.
    ReplaceReplaces files in a specified directory with files from another directory.
    RmdirDeletes the directory.
    RobocopyCopy files and directories using the specified conditions.
    RunasRuns the program with a user and privileges different from the current user.
    Scandisk[DOS][W9x]Performs a check on the disk (drive) and repair the file system.
    SchtasksManages tasks, which execute programs at specific timings.
    SetDisplays or modifies environment variables.
    SetlocalBegins 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.
    SetxAdds or modifies values in user-specific/system-wide environment variable settings.
    ShiftShifts parameters, specified to the batch program, and enables to use 10 or more parameters.
    ShutdownShuts down or restarts the computer.
    SortSorts each line of input data and prints the result.
    Start commandLaunches the program or executes the default processing for the file.
    SubstAssigns 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.
    SysteminfoDisplays system information.
    TakeownSets the owner of the file/directory to the current user.
    TaskkillTerminates the currently running program.
    TasklistDisplays a list of currently running programs.
    TimeDisplays and changes the system time setting.
    TimeoutWaits for a specified duration (waiting for input).
    TitleChanges the title of the prompt window.
    TreeDisplays subdirectories (or files) in the tree format.
    TskillForcefully terminates the running process (program).
    TypeOutputs the file content.
    TzutilDisplays or changes the time zone setting.
    VerPrints the version of MS-DOS or Windows.
    VerifySets whether to verify writing a file to a disk.
    VolDisplays the volume label and volume serial number.
    WaitforSends/receives signals to wait for.
    WhereSearches for files that match the pattern and outputs their locations.
    WhoamiOutputs the username, group names, and permissions based on the current session.
    XcopyCopies 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.
    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.
  • Common environment variables
    COMSPECContains the path to the command interpreter.
    PATHContains the path(s) to search for programs when executing.
    PATHEXTContains a list of extensions to attempt when an extension is omitted.
    PROMPTContains the prompt setting.
    TEMPContains the path to the directory used for temporary data.
    TMPContains 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). ‘’ environment may be differ from ‘cmd.exe’ environment.

Other contents