In the PC operating systems MS-DOS and PC DOS, a number of standard system commands were provided for common tasks such as listing files on a disk or moving files. Some commands were built into the command interpreter, others existed as external commands on disk. Over the several generations of DOS, commands were added for the additional functions of the operating system. In the current Microsoft Windows operating system a text-mode command prompt window can still be used.
Command processing
The command interpreter for DOS runs when no application programs are running. When an application exits, if the transient portion of the command interpreter in memory was overwritten, DOS will reload it from disk. Some commands are internal and built into COMMAND.COM, others are external commands stored on disk. When the user types a line of text at the operating system command prompt, COMMAND.COM will parse the line and attempt to match a command name to a built-in command or to the name of an executable program file or batch file on disk. If no match is found, an error message is printed and the command prompt is refreshed.External commands were too large to keep in the command processor or were less frequently used. Such utility programs would be stored on disk and loaded just like regular application programs but were distributed with the operating system. Copies of these utility command programs had to be on an accessible disk, either on the current drive or on the command path set in the command interpreter.
In the list below, commands that can accept more than one filename, or a filename including wildcards (* and ?), are said to accept a filespec parameter. Commands that can accept only a single filename are said to accept a filename parameter. Additionally, command line switches, or other parameter strings, can be supplied on the command line. Spaces and symbols such as a "/" or a "-" may be used to allow the command processor to parse the command line into file names, file specifications, and other options.
ACALC
External - PC DOS 7- Calculates the value of a mathematical expression.
ACALC [/T[:]format] expression /T Specifies the output format type format D=Decimal (default) B=Binary O=Octal X=heXadecimal A=All (decimal, binary, octal, and hexadecimal) expression Specifies a valid numeric expression. Numbers prefixed with 'b', 'o', and 'x' are assumed to be binary, octal, and hexadecimal respectively. Decimal numbers are not prefixed.
APPEND
External - DOS 3.3 and above- Allows programs to open data files in specified directories as if they were in the current directory.
APPEND [[drive:]path[;...]] [/X[:ON | :OFF]] [/PATH:ON | /PATH:OFF] [/E] APPEND ; [drive:]path Specifies a drive and directory to append. /X:ON Applies appended directories to file searches and application execution. /X:OFF Applies appended directories only to requests to open files. /X:OFF is the default setting. /PATH:ON Applies appended directories to file requests that already specify a path. /PATH:ON is the default setting. /PATH:OFF Turns off the effect of /PATH:ON. /E Stores a copy of the appended directory list in an environment variable named APPEND. /E may be used only the first time you use APPEND after starting your system. Type APPEND ; to clear the appended directory list. Type APPEND without parameters to display the appended directory list.
ASSIGN
External - DOS 2.0 and above
Further information: Drive letter assignment
- Redirects requests for disk operations on one drive to a different drive.
ASSIGN [x[:]=y[:][...]] ASSIGN /STATUS x Specifies the drive letter to reassign. y Specifies the drive that x: will be assigned to. /STATUS Displays current drive assignments. Type ASSIGN without parameters to reset all drive letters to original assignments.
ATTRIB
External - DOS 3.0 and above- Displays or changes file attributes.
ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:][path]filename] [/S] + Sets an attribute. - Clears an attribute. R Read-only file attribute. A Archive file attribute. S System file attribute. H Hidden file attribute. /S Processes files in all directories in the specified path.+S, -S, +H, and -H are available in DOS 5.0 and above.
BACKUP
External - DOS 2.0 and above- Backs up one or more files from one disk to another.
BACKUP source destination-drive: [/S] [/M] [/A] [/F[:size]] [/D:date[/T:time]] [/L[:[drive:][path]logfile]] source Specifies the file(s), drive, or directory to back up. destination-drive: Specifies the drive to save backup copies onto. /S Backs up contents of subdirectories. /M Backs up only files that have changed since the last backup. /A Adds backup files to an existing backup disk. /F:[size] Specifies the size of the disk to be formatted. /D:date Backs up only files changed on or after the specified date. /T:time Backs up only files changed at or after the specified time. /L[:[drive:][path]logfile] Creates a log file and entry to record the backup operation.
BASIC, BASICA and GWBASIC
External - DOS 1.0 to DOS 4.0- An implementation of the BASIC programming language for PCs.
- IBM computers had Cassette BASIC in ROM; BASIC (Disk BASIC) and BASICA (Advanced BASIC) were extensions to the ROM-based Cassette BASIC.
- Microsoft released GW-BASIC for IBM compatible PCs which did not have ROM BASIC. GW-BASIC was a complete BASIC interpreter which was compatible with BASICA. Some OEM releases had BASIC.COM and BASICA.COM as loaders for GWBASIC.EXE. MS-DOS 5.0 and higher included QBasic instead of GW-BASIC.
BREAK
Internal - DOS 2.0 and above- Sets or clears extended CTRL+C checking.
BREAK [ON | OFF] Type BREAK without a parameter to display the current BREAK setting.
CALL
Internal - DOS 3.3 and above- Calls one batch program from another.
CALL [drive:][path]filename [batch-parameters] batch-parameters Specifies any command-line information required by the batch program.
CHCP
Internal - DOS 3.3 and above- Displays or sets the active code page number.
CHCP [nnn] nnn Specifies a code page number. Type CHCP without a parameter to display the active code page number.
CHDIR or CD
Internal - DOS 2.0 and above- Displays the name of or changes the current directory.
CHDIR [drive:][path] CHDIR[..] CD [drive:][path] CD[..] .. Specifies that you want to change to the parent directory. Type CD drive: to display the current directory in the specified drive. Type CD without parameters to display the current drive and directory.
CHKDSK
External - DOS 1.0 and above- Checks a disk and displays a status report.
CHKDSK [drive:][[path]filename] [/F] [/V] [drive:][path] Specifies the drive and directory to check. filename Specifies the file(s) to check for fragmentation. /F Fixes errors on the disk. /V Displays the full path and name of every file on the disk. Type CHKDSK without parameters to check the current disk.CHKDSK originated as an external command in 86-DOS.
CHOICE
External - DOS 6.0 and above- Waits for you to choose one of a set of choices.
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text] /C[:]choices Specifies allowable keys. Default is YN. /N Does not display choices and ? at end of prompt string. /S Treats choice keys as case sensitive. /T[:]c,nn Defaults choice to c after <nn> seconds. text Prompts string to display. ERRORLEVEL is set to offset of key you press in choices.
CIPHER
External - some issues of MS-DOS 2.xx only[1]- Encrypts and decrypts data.
CIPHER keyCIPHER encrypts the data read from standard input using the provided key and sends it to standard output. To decrypt, the data needs to be passed through CIPHER again using the same key.
CLS
Internal - DOS 2.0 and above- Clears the screen.
CLSDR-DOS supports a similar function also during CONFIG.SYS processing, see CLS (CONFIG.SYS directive).
In MS-DOS and PC DOS, COMMAND.COM works by directly calling the corresponding BIOS function to clear the screen, thereby violating the hardware abstraction model otherwise maintained.In DOS Plus and DR-DOS, COMMAND.COM will fall back to this method as well, but only when no ANSI.SYS driver could be detected. If so, they will instead send the ANSI control sequence
ESC [ 2 J
to clear the screen to the attached console.To support other terminal types or control various screen settings
after a CLS, the sequence to be sent can be changed by using the
reserved environment variable $CLS. Due to the difficulties to define environment variables containing binary data COMMAND.COM accepts a special \nnn notation for octal numbers. For example, to send an alternative control sequence like ESC +
(for 1Bh 2Bh as used by ASCII terminals), one could define the variable as follows:This feature is also supported by the command interpreters in Concurrent DOS, Multiuser DOS and REAL/32, with the difference that they have built-in terminal drivers, will never fall back to call BIOS functions, and will default to VT52 rather than ANSI control sequences by default (e.g.
ESC E
).COMMAND
External - DOS 1.0 and above- Starts a new copy of the DOS Command Interpreter.
COMMAND [[drive:]path] [device] [/E:nnnnn] [/P [/MSG]] [/H] [/O] [/Y [/C command | /K command]] [drive:]path Specifies the directory containing COMMAND.COM file. device Specifies the device to use for command input and output. /E:nnnnn Sets the initial environment size to nnnnn bytes. /P Makes the new Command Interpreter permanent (can't exit). /MSG Stores all error messages in memory (requires /P). /H Loads the Command Interpreter into a UMB if available. /O Disables overwrite prompt on COPY,XCOPY,and MOVE commands. /Y Steps through the batch program specified by /C or /K. /C command Executes the specified command and returns. /K command Executes the specified command and continues running. The /P and /MSG switches may be used only when COMMAND is started by using the SHELL command in the CONFIG.SYS file./O and /Y are only available in DOS 6 and above. /H is only available in PC DOS 7.
COMMAND.COM originated in 86-DOS.