List of DOS commands
This article lists notable commands provided by the MS-DOS disk operating system (DOS), especially as used on an IBM PC compatible computer. Other DOS variants as well as the legacy Windows shell, Command Prompt (cmd.exe), provide many of these commands. Many other DOS variants are informally called DOS, but are not included in the scope of the list. The highly related variant, IBM PC DOS, is included. The list is not intended to be exhaustive, but does include commands covering the various releases.
Each command is implemented either as built-in to the command interpreter, COMMAND.COM, or as an external program. Although prevailing style is to write command names in all caps, the interpreter matches ignoring case.
Commands
[edit]APPEND
[edit]Sets the path to be searched for data files or displays the current search path. The APPEND command is similar to the PATH command that tells DOS where to search for program files (files with a .COM, . EXE, or .BAT file name extension).
The command is available in MS-DOS versions 3.2 and later.[1]
ASSIGN
[edit]Redirects requests for disk operations on one drive to a different drive. It can also display drive assignments or reset all drive letters to their original assignments.
The command is available in MS-DOS versions 3 through 5 and IBM PC DOS releases 2 through 5.[1]
ATMDM
[edit]Lists connections and addresses seen by Windows ATM call manager.
ATTRIB
[edit]Changes or views the attributes of one or more files. Defaults to display the attributes of all files in the current directory. The file attributes available include read-only, archive, system, and hidden attributes. The command has the capability to process whole folders and subfolders of files and also process all files.
The command is available in MS-DOS versions 3 and later.[1]
BACKUP and RESTORE
[edit]These are commands to backup and restore files from an external disk. These appeared in version 2, and continued to PC DOS 5 and MS-DOS 6 (PC DOS 7 had a deversioned check). In DOS 6, these were replaced by commercial programs (CPBACKUP, MSBACKUP), which allowed files to be restored to different locations.[1]
BASIC and BASICA
[edit]Environment for programming in BASIC. IBM computers had BASIC 1.1 in ROM, and IBM's versions of BASIC used code in this ROM-BASIC, which allowed for extra memory in the code area. BASICA last appeared in IBM PC DOS 5.02, and in OS/2 (2.0 and later), the version had ROM-BASIC moved into the program code. Microsoft released GW-BASIC for machines with no ROM-BASIC. Some OEM releases had basic.com and basica.com as loaders for GW-BASIC.EXE. BASIC was dropped after MS-DOS 4, and PC DOS 5.02. OS/2 (which uses PC DOS 5), has it, while MS-DOS 5 does not.
BREAK
[edit]Instructs DOS to check whether the Ctrl and Break keys have been pressed before carrying out a program request.
The command is available in MS-DOS versions 2 and later.[1]
CALL
[edit]Starts a batch file from within another batch file and returns when that one ends.
The command is available in MS-DOS versions 3.3 and later.[1]
CD and CHDIR
[edit]Sets the working directory or with no arguments displays the current value. Both names, CD and CHDIR, refer to the same command and are abbreviations of the phrase "change directory".
The command is available in MS-DOS versions 2 and later.[1]
CHCP
[edit]Either displays or changes the active code page used to display character glyphs in a console window. Similar functionality can be achieved with MODE CON: CP SELECT=yyy.
The command is available in MS-DOS versions 3.3 and later.[1]
CHKDSK
[edit]Verifies and possibly fixes data integrity of a storage volume.
The command is available in MS-DOS versions 1 and later.[1]
CHOICE
[edit]Prompts the user to select one item from a set of single-character choices. The command was introduced as an external command with MS-DOS 6.0,[1][2] Novell DOS 7[3] and PC DOS 7.0. Earlier versions of DR-DOS supported this function with the built-in switch command (for numeric choices) or by beginning a command with a question mark.[3] This command was formerly called ync (yes-no-cancel).
CLS
[edit]The CLS or CLRSCR command clears the terminal screen.
The command is available in MS-DOS versions 2 and later.[1]
COMMAND
[edit]Start a new instance of the command interpreter.
The command is available in MS-DOS versions 1 and later.[1]
COMP
[edit]Show differences between any two files, or any two sets of files.
The command is available in MS-DOS versions 3.3 through 5 and IBM PC DOS releases 1 through 5.[1]
COPY
[edit]Makes copies of files.
The command is available in MS-DOS versions 1 and later.[1]
CTTY
[edit]Defines the terminal device (for example, COM1) to use for input and output.[4]
The command is available in MS-DOS versions 2 and later.[1]
DATE
[edit]Displays the system date and prompts the user to enter a new date. Complements the TIME command.
The command is available in MS-DOS versions 1 and later.[1]
DBLBOOT
[edit]This section needs expansion. You can help by adding missing information. (May 2019) |
A batch file added to DOS 6.X Supplemental Disks to help create DoubleSpace boot floppies.[5]
DBLSPACE
[edit]A disk compression utility supplied with MS-DOS version 6.0 (released in 1993) and version 6.2.[1]
DEBUG
[edit]A primitive assembler and disassembler.
DEFRAG
[edit]Analyzes the file fragmentation of a disk drive and defragments a drive. This command is called DEFRAG in MS-DOS/PC DOS and diskopt in DR-DOS.
The command is available in MS-DOS versions 6 and later.[1]
DEL and ERASE
[edit]Deletes files. Both names provide the same functionality.
The command is available in MS-DOS versions 1 and later.[1]
DELTREE
[edit]Deletes a directory along with all of the files and subdirectories that it contains. Normally, it will ask for confirmation of the potentially dangerous action. Since the RD (RMDIR) command can not delete a directory if the directory is not empty (except in Windows NT & 10), the DELTREE command can be used to delete the whole directory.
The deltree command is included in certain versions of Microsoft Windows and MS-DOS operating systems. It is specifically available only in versions of MS-DOS 6.0 and higher,[1] and in Microsoft Windows 9x. In Windows NT, the functionality provided exists but is handled by the command rd or rmdir which has slightly different syntax. In Windows 10, the command switch is RD /S or RMDIR /S.
DIR
[edit]Displays the contents of a directory. Output consists of the disk's volume label and serial number; one directory or filename per line, including the filename extension, the file size in bytes, and the date and time the file was last modified; and the total number of files listed, their cumulative size, and the free space (in bytes) remaining on the disk. The command is one of the few commands that exist from the first versions of DOS.[1] The command can display files in subdirectories. The resulting directory listing can be sorted by various criteria and filenames can be displayed in a chosen format.
DISKCOMP
[edit]Compares the complete contents of a floppy disk to another one.
The command is available in MS-DOS versions 3.2 and later and IBM PC DOS releases 1 and later.[1]
DISKCOPY
[edit]Copies the complete contents of a diskette to another diskette.
The command is available in MS-DOS versions 2 and later.[1]
DOSKEY
[edit]Adds command history, macro functionality, and improved editing features to the command-line interpreter.
The command is available in MS-DOS versions 5 and later.[1]
DOSSIZE
[edit]This section needs expansion. You can help by adding missing information. (April 2020) |
Displays how much memory various DOS components occupy.[6]
DRVSPACE
[edit]A disk compression utility supplied with MS-DOS version 6.22.[1]
ECHO
[edit]Prints text to the DOS equivalent of the standard output stream. Usually, this means directly to the screen, but the output can be redirected, like any other command, to files or devices. Often used in batch file.
Another important use of the echo command is to toggle echoing of commands on and off in batch files. Traditionally batch files begin with the @echo off statement. This says to the interpreter that echoing of commands should be off during the whole execution of the batch file, thus resulting in a "tidier" output (the @ symbol declares that this particular command (echo off) should also be executed without echo.)
The command is available in MS-DOS versions 2 and later.[1]
EDIT
[edit]A full-screen text editor, included with MS-DOS versions 5 and 6,[1] OS/2 and Windows NT to 4.0. The corresponding program in Windows 95 and later, and Windows 2000 and later is Edit v2.0. PC DOS 6 and later use the DOS E Editor and DR-DOS used editor up to version 7.
EDLIN
[edit]DOS line-editor. It can be used with a script file, like debug, this makes it of some use even today. The absence of a console editor in MS-DOS/PC DOS 1–4 created an after-market for third-party editors.
In DOS 5, an extra command "?" was added to give the user much-needed help.
DOS 6 was the last version to contain EDLIN; for MS-DOS 6, it's on the supplemental disks,[1] while PC DOS 6 had it in the base install. Windows NT 32-bit, and OS/2 have Edlin.
EMM386
[edit]This section needs expansion. You can help by adding missing information. (July 2019) |
Enables or disables EMM386 expanded-memory support on a computer with an 80386 or higher processor.
The command is available in MS-DOS versions 5 and later.[1]
ERASE
[edit]See: DEL and ERASE
EXE2BIN
[edit]Converts an executable (.exe) file into a binary file with the extension .com, which is a memory image of the program.
The size of the resident code and data sections combined in the input .exe file must be less than 64 KB. The file must also have no stack segment.
The command is available in MS-DOS versions 1 through 5. It is available separately for version 6 on the Supplemental Disk.[1]
EXIT
[edit]Exits the current command processor. If the exit is used at the primary command, it has no effect unless in a DOS window under Microsoft Windows, in which case the window is closed and the user returns to the desktop.
The command is available in MS-DOS versions 2 and later.[1]
EXPAND
[edit]The Microsoft File Expansion Utility is used to uncompress one or more compressed cabinet files (.CAB). The command dates back to 1990 and was supplied on floppy disc for MS-DOS versions 5 and later.[7][1]
FAKEMOUS
[edit]This section needs expansion. You can help by adding missing information. (May 2019) |
An IBM PS/2 mouse utility used with AccessDOS. It is included on the MS-DOS 6 Supplemental Disk.[8][9] AccessDOS assists persons with disabilities.
FASTHELP
[edit]Provides information for MS-DOS commands.
FASTOPEN
[edit]Provides accelerated access to frequently-used files and directories.
The command is available in MS-DOS versions 3.3 and later.[1]
FC
[edit]Shows differences between two files, or two sets of files.
The command is available in MS-DOS versions 2 and later – primarily non-IBM releases.[1]
FDISK
[edit]Manipulates hard disk partition tables. The name derives from IBM's habit of calling hard drives fixed disks. FDISK has the ability to display information about, create, and delete DOS partitions or logical DOS drive. It can also install a standard master boot record on the hard drive.
The command is available in MS-DOS versions 3.2 and later and IBM PC DOS 2.0 releases and later.[1]
FIND
[edit]A filter to find lines in the input data stream that contain or don't contain a specified string and send these to the output data stream. It may also be used as a pipe.
The command is available in MS-DOS versions 2 and later.[1]