List of DOS commands
Encyclopedia
In the personal computer
Personal computer
A personal computer is any general-purpose computer whose size, capabilities, and original sales price make it useful for individuals, and which is intended to be operated directly by an end-user with no intervening computer operator...

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

 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-in to the command interpreter, others existed as transient commands loaded into memory when required. Over the several generations of MS-DOS, commands were added for the additional functions of the operating system. In the current Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 operating system a text-mode command prompt window can still be used. Some DOS commands carry out functions equivalent to those in a UNIX
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 system but always with differences in details of the function.

Resident and transient commands

The command interpreter for MS-DOS runs when no application programs are running. When an application exits, if the command interpreter in memory was overwritten, MS-DOS will re-load it from disk. The command interpreter is usually stored in a file called "COMMAND.COM". Some commands are internal and built-into COMMAND.COM, others are stored on disk in the same way as application programs. 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
Batch file
In DOS, OS/2, and Microsoft Windows, batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter....

 on disk. If no match is found, an error message is printed and the command prompt is refreshed.

Resident commands varied slightly between revisions of MS-DOS. Typically, the functions DIR (list directory), ERASE or DEL (erase a file or directory), COPY (copy files), DATE (display or set date), TIME (display or set time), CD (change working directory), MD (make a directory on the current disk), REN (rename a file or directory) and some others were resident in COMMAND.COM.

Transient 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 logged-in floppy drive or on the command path
Path (computing)
A path, the general form of a filename or of a directory name, specifies a unique location in a file system. A path points to a file system location by following the directory tree hierarchy expressed in a string of characters in which path components, separated by a delimiting character, represent...

 set in the command interpreter.

A special type of external, transient command is the batch file
Batch file
In DOS, OS/2, and Microsoft Windows, batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter....

, containing a set of commands that are processed as if entered at the command line. Some additional keywords are recognized by the command interpreter COMMAND.COM to make batch files more useful. These commands aren't useful if typed in interactively at the command prompt, but allow flexible processing by a batch file.

Command line arguments

In the list below, commands that can accept more than one filename, or a filename including wildcards (* and ?), are said to accept a filespec
Filespec
In MS-DOS and Microsoft Windows, filespec is a term meaning a filename identifier that specifies both the name and location of a single file.The filespec differs from the filename in that the filespec includes a complete specification, within a particular file system, of the file's location. Thus,...

parameter. Commands that can accept only a single filename are said to accept a filename parameter. Additionally, zero or more 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.

In DOS commands, unlike Unix, lower-case and capital letters are equivalent for file name specifiers; DOS commands preserve case, but do not require file specifiers to match case. Often parameters or arguments are also independent of case, especially in those programs developed only for DOS. Utility programs that also have versions running under UNIX-like operating systems often use upper and lower case arguments to mean different things. Sometimes a hyphen ("-") may be used instead of a slash ("/"); very early versions of DOS made the setting of the delimiter character a user-controlled option.

Commands which are not built into the command interpreter may follow the same conventions.

For some commands, a UNIX
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 command with similar functions is given. Comparisons are approximate. While many commands are the same across many DOS systems (MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

, PC DOS, DR-DOS
DR-DOS
DR-DOS is an MS-DOS-compatible operating system for IBM PC-compatible personal computers, originally developed by Gary Kildall's Digital Research and derived from Concurrent PC DOS 6.0, which was an advanced successor of CP/M-86...

, FreeDOS
FreeDOS
FreeDOS is an operating system for IBM PC compatible computers. FreeDOS is made up of many different, separate programs that act as "packages" to the overall FreeDOS Project...

, etc.) some differ in command syntax or name.

Windows command prompt

Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 supports a number of commands which may be invoked by typing them in a command window; they are usually similar to their MS-DOS equivalents. Typing help followed by a carriage return at a command prompt will list the commands. File and path names used as arguments may be long, unlike MS-DOS names in "8.3" form, and may contain embedded spaces; names with spaces must be enclosed between a pair of double-quote character (").

Two command-line interfaces can be used in original DOS systems. Since this 16-bit executable is based on the DOS command.com, it does not support all the extended file-name syntax of Windows.

@

Commands beginning with the @ command are never echoed before running. The main use is to prevent batch echo by placing a command @echo off at the beginning of batch files.

A colon in front of a word, like :label , designates a label. Unlike remarks (REM), labels are not processed by the command processor, so comments might be added proceeded by a pair of colons, eg ::, or by a colon and space.

;

Semicolons at the beginning of the line are usually processed by the command processor, but most other programs ignore these. This might be used to add a small batch file to the beginning of a program's data file, in the way that EXTPROC works.

/*

In PC DOS, OS/2 thus 4OS2, 4DOS, 4NT etc, a batch file beginning with /* is treated as a REXX
REXX
REXX is an interpreted programming language that was developed at IBM. It is a structured high-level programming language that was designed to be both easy to learn and easy to read...

 script. PC DOS 7.0, 2000 and 7.1 implement this feature.

In REXX, as in C, comments are surrounded by a matching /* comment */.

Commands surrounded by parenthesis ('(' and ')') are treated as a single command. This is very useful to execute several commands in the same iteration of a FOR loop.

append

Displays or sets the search path for data files. DOS will search the specified path(s) if the file is not found in the current path. This had some creative uses, such as allowing non-CD based games to be run from the CD, using configuration/save files stored on the hard drive.


append;
append [d:]path[;][d:]path[...]
append [/X:on|off][/E]

assign

The command redirects requests for disk operations on one drive to a different drive.


assign [x[:]=y[:]...
assign /STATUS

Options:
  • x The drive letter to reassign.
  • y The drive letter that x: will be assigned to.
  • /STATUS Displays the current drive assignments.

If typed without parameters then all drive letters are reset to original assignments.

The command is available in MS-DOS 5.00.

attrib

Attrib
Attrib
attrib is a command, in DOS, OS/2 and Microsoft Windows. The function of attrib is to set and remove file attributes...

 changes or views the attributes of one or more files. It defaults to displaying the attributes of all files in the current directory.


ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H][drive:][path][filename] [/S [/D]]

Options:
  • To add an attribute attach a '+' in front of it.
  • To remove an attribute attach a '-' in front of it
  • Attributes include
    • R - Read-only
    • A - Archive
    • S - System
    • H - Hidden
    • /D - Process folders as well.
    • /S - Process matching files in the current folder and all subfolders.


Note: Everything inside a brace [option] is an optional item.
Roughly equivalent to the Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 commands chattr
Chattr
chattr is a command in the Linux operating system that allows a user to set certain attributes on a file residing on an ext2-based filesystem. chflags is the analogous command on modern BSD systems, including Mac OS X. The commands are similar to the attrib command on DOS, OS/2 and Microsoft Windows...

and lsattr
Lsattr
lsattr is a command-line program for listing the attributes on a Linux second extended file system . It is also a command to display attributes of devices on an AIX operating system.-Options:The form of the lsattr command :...

.

backup and restore

Programs to back up 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.

BASIC and BASICA

An implementation of the BASIC programming language for PCs. The Basic language as implemented by this was a very common operating system on 8- and 16-bit machines that were made in the 1980's.

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 IBMDOS 5.02, and in OS/2 (2.0 and later), the version had ROMBASIC 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 NT (MS-DOS 5) does not.

call

Calls one batch program from another. A new batch file context is created with the specified arguments and control is passed to the statement after the label specified.


Syntax:
call [filespec][batch file parameters]
  • filespec: name and if necessary path of the new batch file
  • parameters: switches

cd or chdir
Chdir
cd, sometimes also available as chdir , is a command line command to change the current working directory in operating systems such as Unix, DOS, OS/2, AmigaOS , Windows, and Linux...

 

Change current working directory
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

. Displays the current working directory when used without a path parameter.


cd
displays the current working directory on the current drive.

cd directory
changes the working directory on the current drive to directory.

chdir e:directory
changes the working directory on E: to directory.

cd ..
changes the working directory to the parent directory (up one directory level).

cd \
changes the working directory to the root (top level) directory of the current drive.
Equivalent to the Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 command cd
Chdir
cd, sometimes also available as chdir , is a command line command to change the current working directory in operating systems such as Unix, DOS, OS/2, AmigaOS , Windows, and Linux...

(with a path parameter), or pwd
Pwd
In Unix-like and some other operating systems, the pwd command is used to output the path of the current working directory.The command is a shell builtin in certain Unix shells such as sh, and bash...

(without a parameter). cd .. changes to the parent directory.

chcp

Changes the code page
Windows code page
Windows code pages are sets of characters or code pages used in Microsoft Windows from the 1980s and 1990s...

 used to display character glyphs
Glyph
A glyph is an element of writing: an individual mark on a written medium that contributes to the meaning of what is written. A glyph is made up of one or more graphemes....

 in a console window
Win32 console
Win32 console is a text user interface implementation within the system of Windows API, which runs console applications. A Win32 console has a screen buffer and an input buffer, and is available both as a window or in text mode screen, with switching back and forth available via Alt-Enter...

.


chcp [codepage]

With a numeric parameter, this command changes the codepage setting to codepage. Without a parameter, the command displays the currently active codepage. The codepage 1252 lets use the GUI charset in the command line, while 65001 is utf-8.

chkdsk
CHKDSK
CHKDSK is a command on computers running DOS, OS/2 and Microsoft Windows operating systems that displays the file system integrity status of hard disks and floppy disk and can fix logical file system errors. It is similar to the fsck command in Unix.The command is implemented as an executable...

 

Verifies a storage volume (hard disk, partition, floppy disk
Floppy disk
A floppy disk is a disk storage medium composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that removes dust particles...

, flash drive, etc) for file system integrity.


Options:
  • /F : Fixes errors on the volume (without /F, chkdsk only detects errors)
  • /P : Forces a full verification
  • /R : Searches for defective sectors and recovers legible information (applies /F)
  • /X : Unmounts
    Mount (computing)
    Mounting takes place before a computer can use any kind of storage device . The user or their operating system must make it accessible through the computer's file system. A user can access only files on mounted media.- Mount point :A mount point is a physical location in the partition used as a...

     the volume before processing if needed. (Note: Unmounting temporarily invalidates all pointers/handlers to the volume until process is completed)


chkdsk volume letter: path filename [/F] [/P] [/R] [/X]
Equivalent to the Unix command fsck
Fsck
The system utility fsck is a tool for checking the consistency of a file system in Unix and Unix-like operating systems such as Linux.-Use:...


choice
Choice (command)
In computing, CHOICE is a DOS command that allows for batch files to prompt the user to select one item from a set of single-character choices. It was introduced as an external command with MS-DOS 6.0, Novell DOS 7 and PC DOS 7.0, and is also available from the command line shell of some versions...

 

Allows for batch files to prompt the user to select one item from a set of single-character choices.

Choice
Choice (command)
In computing, CHOICE is a DOS command that allows for batch files to prompt the user to select one item from a set of single-character choices. It was introduced as an external command with MS-DOS 6.0, Novell DOS 7 and PC DOS 7.0, and is also available from the command line shell of some versions...

 was introduced as an external command with MS-DOS 6.0; Novell DOS 7 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.

This command was formerly called ync (yes-no-cancel).

cls
Cls (computing)
cls is a command used by the command line interpreters COMMAND.COM and cmd.exe on DOS, OS/2 and Microsoft Windows operating systems to clear the screen or console window of commands and any output generated by them. It does not clear the user's history of commands, however...

 

Clears the screen.


cls
Equivalent to the Unix clear
Clear (Unix)
' is a standard Unix computer operating system command which is used to clear the screen.Depending on the system, clear uses the terminfo or termcap database, as well as looking into the environment for the terminal type in order to deduce how to clear the screen. The Unix command clear takes no...

.

copy
Copy (command)
In computing, copy is a command in RT-11, RSX-11, OpenVMS, DOS, OS/2 and Microsoft Windows operating systems. The command copies computer files from one directory to another. The destination defaults to the current working directory. If more than one source file is indicated, the destination must...

 

Copies files from one location to another. The destination defaults to the current directory. If multiple source files are indicated, the destination must be a directory, or an error will result.

Syntax:

copy [source\filename] [destination\folder]
Files may be copied to devices. For example, copy file lpt1 sends the file to the printer on LPT1. copy file con outputs file to the screen ("console"), which can also be done using type file. Devices themselves may be copied: copy con file takes the text typed into the console and puts it into file, stopping when EOF
End-of-file
In computing, end of file is a condition in a computer operating system where no more data can be read from a data source...

 (Ctrl+Z) is typed.

Files may be concatenated using +. For example, copy file1+file2 file_cat will concatenate the files and output them as file_cat. There are two switches to modify the command's behaviour, /a (text mode, the default) and /b (binary mode). In text mode, copy will stop when it reaches the EOF
End-of-file
In computing, end of file is a condition in a computer operating system where no more data can be read from a data source...

 character; in binary mode, the files will be concatenated in their entirety, ignoring EOF characters.

Examples of usage:

copy /a alpha.txt + beta.txt gamma.txt
copy /b alpha.mpg + beta.mpg gamma.mpg
Equivalent Unix commands are cp
Cp (Unix)
cp is a UNIX command used to copy a file. Files can be copied either to the same directory or to a completely different directory, possibly on a different file system or hard disk drive. If the file is copied to the same directory, the new file must have a different name to the original; in all...

(for copying) and cat
Cat (Unix)
The cat command is a standard Unix program used to concatenate and display files. The name is from catenate, a synonym of concatenate.- Specification :...

(for concatenation). Device files may be copied in Unix as well, e.g. cp file /dev/tty will display a file on the screen (but cat file is more commonly used here).
Equivalent RT-11
RT-11
RT-11 was a small, single-user real-time operating system for the Digital Equipment Corporation PDP-11 family of 16-bit computers...

/RSX-11
RSX-11
RSX-11 is a family of real-time operating systems mainly for PDP-11 computers created by Digital Equipment Corporation , common in the late 1970s and early 1980s. RSX-11D first appeared on the PDP-11/40 in 1972...

/OpenVMS
OpenVMS
OpenVMS , previously known as VAX-11/VMS, VAX/VMS or VMS, is a computer server operating system that runs on VAX, Alpha and Itanium-based families of computers. Contrary to what its name suggests, OpenVMS is not open source software; however, the source listings are available for purchase...

 command is copy.

Examples of usage:

copy con filename.extension

Everything typed at the console is sent to the file, until a control Z character is typed.

ctty 

Defines the device to use for input and output.

Syntax:

ctty device
  • device: The terminal device to be used.

Example of usage:

ctty COM1
hello

defrag

(in MS-DOS/PC DOS; diskopt in DR-DOS)
Defragments
Defragmentation
In the maintenance of file systems, defragmentation is a process that reduces the amount of fragmentation. It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous regions . It also attempts to create larger regions of...

 a disk drive.

Options:
  • -A – Analyses the fragmentation of a disk drive
  • -F – Force defragmentation even if disk space is low
  • -V – Verbose output mode
  • -H – Defrag hidden files

Example of usage:

defrag driveletter: -a -v
No Unix equivalent.

del or erase
Del (command)
In computing, del is a command in various DOS, OS/2 and Microsoft Windows command line interpreters such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell. It is used to delete one or more files or directories from a filesystem. It is analogous to the Unix rm command...

 

Deletes one or more files.


This command is used to delete a particular or more files.

Syntax:
del filename
erase filename

Options
*.* All files in current folder
*.* /s all files in current folder and sub folders,
Equivalent to the Unix command rm
Rm (Unix)
rm is a basic UNIX command used to remove objects such as files, directories, device nodes, symbolic links, and so on from the filesystem...

.
Equivalent in RT-11/RSX-11/OpenVMS operating systems line is delete command which can be contracted to del.

deltree
Deltree
deltree is a command line command in Microsoft operating systems that deletes an entire subdirectory of files. It appeared in MS-DOS 6, and was retained throughout all Windows versions based upon MS-DOS, including Windows 95, Windows 98, and Windows Me...

 

Deletes a directory along with all of the files and subdirectories that it contains. Normally, it will ask for confirmation of such a drastic action.


deltree [/y] directory
The /y parameter, if present, tells the deltree command to carry out without first prompting for confirmation.

The deltree command is included in certain versions of Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 and Microsoft DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

 Operating Systems
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

. It is specifically available only in versions of MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

 6.0 and higher, and in Microsoft Windows 9x
Windows 9x
Windows 9x is a generic term referring to a series of Microsoft Windows computer operating systems produced since 1995, which were based on the original and later modified Windows 95 kernel...

.

In Microsoft Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

, the functionality provided exists but is handled by the command "rd" or "rmdir" which has slightly different syntax.

However this behavior can also be achieved on almost any version Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 or Microsoft DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

 by using the "del" or "erase" command as in the following example:


del /s /f [/q] directory && rd /s [/q] directory
In Unix, the functionality of deltree is provided by the rm
Rm (Unix)
rm is a basic UNIX command used to remove objects such as files, directories, device nodes, symbolic links, and so on from the filesystem...

command with the parameter -r (or -rf for the /y switch).

dir 

Lists the contents of a directory.


The dir command typed by itself, displays 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.

dir [drive:][path][filename] [parameters]

Most commonly used parameters of dir include:
  • /W : Displays the listing in wide format, with as many as five filenames or directory names on each line.
  • /P : Pause at every page
  • /S : Also look in subdirectories
  • /Axx: Display files with the specified attributes only
  • /Oxx: Modifies sort order
  • /B : Uses bare format (no heading information or summary)
  • > [drive:][path]filename : To Store Result in a text file;(c:\dir > c:\fileList.txt) (this is not a parameter, it is output redirection)


Possible attributes for the A parameter are D (directories), R (read-only files), H (hidden files), A (files/directories with the archive bit on), and S (system files). The prefix - negates an attribute; attributes can be combined (e.g. /A:DA means directories with the archive bit on).

Possible sort orders are N (name), S (size), E (extension), D (date and time), A (last access date), and G (group directories first). The prefix - reverses the order.

Other less commonly used parameters of dir include:
  • /D : Display wide format but sorted by column
  • /L : Display forced into lowercase
  • /N : Display forced into long file name format instead of 8.3
  • /Q : Displays the owner of each file
  • /X : Display shows 8.3 names next to long file names


The default parameters of dir can be set using the DIRCMD environment variable.

Equivalent to the Unix command ls
Ls
In computing, ls is a command to list files in Unix and Unix-like operating systems. ls is specified by POSIX and the Single UNIX Specification.- History :An ls utility appeared in the original version of AT&T UNIX...

(the option -l is "long" list format, it works in the opposite manner to /w.)

Equivalent in RT-11/RSX-11/OpenVMS operating systems line is directory command which can be contracted to dir.

echo 

Prints its own arguments back out to the DOS equivalent of the standard output stream
Standard streams
In Unix and Unix-like operating systems , as well as certain programming language interfaces, the standard streams are preconnected input and output channels between a computer program and its environment when it begins execution...

. Usually, this means directly to the screen, but the output of echo can be redirected like any other command. Often used in batch file
Batch file
In DOS, OS/2, and Microsoft Windows, batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter....

s to print text out to the user.

echo this is text Outputs 'this is text'
echo. Outputs a blank line
Another important use of the echo command is to toggle echoing of commands on and off in batch files.

echo on turns on echoing of commands
echo off turns off echoing of commands
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. For example the following 2 batch files are equivalent:

Batch1.bat:


@echo off
echo The files in your root directory:
dir /b /a-d c:\

Batch2.bat:


@echo The files in your root directory:
@dir /b /a-d c:\

Echo can be used to write to files directly from the console, by redirecting the output stream:

echo text > filename
Echo can also be used to append to files directly from the console, again by redirecting the output stream:

echo text >> filename
Echo can also be used to redirecting the output stream to a device:

echo This line will print on a line printer. >> LPT1:
To type more than one line from the console into a file, use copy con (above).
Equivalent to the Unix command echo.

edit 

Full-screen text editor, included with MS-DOS 5 and 6, OS/2 and Windows NT to 4.0
  • Windows 95 and later, and W2k and later use Edit v2.0
  • PC DOS 6 and later use the DOS E Editor.
  • DR-DOS used editor up to version 7.

edlin
Edlin
Edlin is a line editor included with MS-DOS and later Microsoft operating systems. It provides rudimentary capabilities for editing plain text files through a command-driven interface. Line numbers are specified using numerals, and operations are specified using single-character alphabetic...

 

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, PC DOS 6 had it in the base install. Windows NT 32-bit, and OS/2 have Edlin.

exe2bin 

Converts an executable
Executable
In computing, an executable file causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a data file that must be parsed by a program to be meaningful. These instructions are traditionally machine code instructions for a physical CPU...

 (.exe) file into a binary file
Binary file
A binary file is a computer file which may contain any type of data, encoded in binary form for computer storage and processing purposes; for example, computer document files containing formatted text...

 with the extension
Filename extension
A filename extension is a suffix to the name of a computer file applied to indicate the encoding of its contents or usage....

 .com
COM file
In many computer operating systems, a COM file is a type of executable file; the name is derived from the file name extension .COM. Originally, the term stood for "Command file", a text file containing commands to be issued to the operating system , on many of the Digital Equipment Corporation mini...

, 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 64KB. The file must also have no stack segment.

exit
Exit (command)
exit is a command used in many operating system command line shells and scripting languages. The command causes the shell or program to terminate. If performed within an interactive command shell, the user is logged out of their current session, and/or user's current console or terminal connection...

 

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.


exit [/B]
/B When used within a batch script, exits the script without closing the calling DOS window
Exit also exists in Unix-shells. If an exit command is used in the primary command shell under Unix, however, it will logoff the user, similar to the control-D keystroke.

extproc

Passes batch file to an external processor. This command appears in OS/2's cmd.exe, and by way of 4OS2 and 4NT, into the 4nt system. In general, DOS has no way of passing batches to external processors, except by a small batch file at the lead.

fc
Microsoft File Compare
In computing, fc is a command line program that compares multiple files and outputs the differences between them. The fc command has been included in Microsoft operating systems since MS-DOS 2.0 and is included in all versions of Microsoft Windows.The command is equivalent to the Unix commands...

 or comp

Compares two files or sets of files and displays the differences between them.


FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/W] [/nnnn] [drive1:][path1]filename1 [drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2
/A Displays only first and last lines for each set of differences.
/B Performs a binary comparison.
/C Disregards the case of letters.
/L Compares files as ASCII text.
/LBn Sets the maximum consecutive mismatches to the specified number of lines.
/N Displays the line numbers on an ASCII comparison.
/T Does not expand tabs to spaces.
/W Compresses white space (tabs and spaces) for comparison.
/nnnn Specifies the number of consecutive lines that must match after a mismatch.
[drive1:][path1]filename1 Specifies the first file or set of files to compare.
[drive2:][path2]filename2 Specifies the second file or set of files to compare.
Equivalent to the Unix commands comm
Comm
The comm command in the Unix family of computer operating systems is a utility that is used to compare two files for common and distinct lines. comm is specified in the POSIX standard. It has been widely available on Unix-like operating systems since the mid to late 1980s.-Usage:comm reads two...

, cmp and diff
Diff
In computing, diff is a file comparison utility that outputs the differences between two files. It is typically used to show the changes between one version of a file and a former version of the same file. Diff displays the changes made per line for text files. Modern implementations also...

.

fdisk
Fdisk
On personal computer operating systems, fdisk is a commonly used name for a command-line utility that provides disk partitioning functions...

 

Manipulates hard disk partition tables. The name derives from IBM's habit of calling hard drives fixed disks. When run from the command line, it displays a menu of various partitioning operations:


1. Create DOS partition or Logical DOS Drive
2. Set active partition
3. Delete partition or Logical DOS Drive
4. Display partition information
5. Change current fixed disk drive (only available if the computer has more than one hard drive)
FDISK /MBR installs a standard master boot record on the hard drive.

FDISK /MBR #: where # is other partition on system. Completes above command on indicated partition.

e.g.: "C:\FDISK /MBR D:" would install boot record on D:\ partition.
Fdisk exists under Unix with the same name, but it is an entirely different program. However they share purposes.

find
Find (command)
In computing, find is a command in the command line interpreters of DOS, OS/2 and Microsoft Windows. It is used to search for a specific text string in a file or files...

 

A filter
Filter (software)
A filter is a computer program to process a data stream. Some operating systems such as Unix are rich with filter programs. Even Windows has some simple filters built into its command shell, most of which have significant enhancements relative to the similar filter commands that were available in...

 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.

Find may also be used as a pipe
Pipeline (software)
In software engineering, a pipeline consists of a chain of processing elements , arranged so that the output of each element is the input of the next. Usually some amount of buffering is provided between consecutive elements...

.



find "keyword" < inputfilename > outputfilename

Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] "string" drive:][path]filename[ ...

/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string.
/N Displays line numbers with the displayed lines.
/I Ignores the case of characters when searching for the string.
"string" Specifies the text string to find.
[drive:][path]filename Specifies a file or files to search.

If a pathname is not specified, FIND searches the text typed at the prompt
or piped from another command.

Equivalent to the Unix command grep
Grep
grep is a command-line text-search utility originally written for Unix. The name comes from the ed command g/re/p...

. The Unix command find
Find
In Unix-like and some other operating systems, find is a command-line utility that searches through one or more directory trees of a file system, locates files based on some user-specified criteria and applies a user-specified action on each matched file...

performs an entirely different function analogous to dir /s.

for 

The FOR loop can be used to parse a file or the output of a command.


FOR [switches] %variable IN (set) DO command [parameters for command]

[switches] /D
Use for finding directory names if (set) contains wildcards and is a dir command
/R format]]
Deletes the [[File Allocation Table [/Q] [/F:size] [/B | /S] [/C]
FORMAT drive: [/V[:label]] [/Q] [/T:tracks /N:sectors] [/B | /S] [/C]
FORMAT drive: [/V[:label]] [/Q] [/1] [/4] [/B | /S] [/C]
FORMAT drive: [/Q] [/1] [/4] [/8] [/B | /S] [/C]
/V[:label] Specifies the volume label.
/Q Performs a quick format.
/F:size Specifies the size of the floppy disk to format (such
as 160, 180, 320, 360, 720, 1.2, 1.44, 2.88).
/B Allocates space on the formatted disk for system files.
/S Copies system files to the formatted disk.
/T:tracks Specifies the number of tracks per disk side.
/N:sectors Specifies the number of sectors per track.
/1 Formats a single side of a floppy disk.
/4 Formats a 5.25-inch 360K floppy disk in a high-density drive.
/8 Formats eight sectors per track.
/C Tests clusters that are currently marked "bad."
There is also an undocumented /u parameter for "unconditional" that will write strings of zeros on every sector. This is now an official switch in Windows Vista and 7 but with the parameter /p instead.
Equivalent to the Unix command mkfs
Mkfs
mkfs is the Linux/GNU command for formatting a disk partition with a specific filesystem.- Syntax :The basic syntax is: mkfs -t type device...

.
Equivalent in RT-11/RSX-11/OpenVMS operating systems line is format command which can not create filesystem. After formatting one should use initialize (contracted to init) command to create filesystem (Equivalent to MS-DOS command format /q or "quick format").

help
Help (command)
In computing, help is a command in various command line shells such as COMMAND.COM, cmd.exe, 4DOS/4NT, Windows PowerShell, Bash, Singularity shell, Python and GNU Octave. It provides online information about available commands and the shell environment. It is analogous to the Unix man command...

 

Gives help about DOS.
MS-DOS
help 'command' would give help on a specific command. By itself, it lists the contents of DOSHELP.HLP. Help for a specific command invokes the command with the /? option. In MS-DOS 6.x this command exists as FASTHELP.
MS-DOS 6.xx help command uses QBASIC
QBasic
QBasic is an IDE and interpreter for a variant of the BASIC programming language which is based on QuickBASIC. Code entered into the IDE is compiled to an intermediate form, and this intermediate form is immediately interpreted on demand within the IDE. It can run under nearly all versions of DOS...

 to view a quickhelp HELP.HLP file, which contains more extensive information on the commands, with some hyperlinking etc. The MS-DOS 6.22 help system is included on Windows 9x cdrom versions as well.
PC DOS
PC DOS 5,6 help is the same form as MS-DOS 5 help command.
PC DOS 7.xx help uses view.exe to open OS/2 style .INF files (cmdref.inf, dosrexx.inf and doserror.inf), opening these to the appropriate pages.
DR-DOS
In DR-DOS, help is a batch file that launches DR-DOS' reference, dosbook.
Microsoft Windows
Windows NT, all versions, uses DOS 5 style help, but versions before VISTA have also a Windows help file (NTCMDS.HLP or NTCMDS.INF) in a similar style to MS-DOS 6.
FreeDOS
FreeDOS uses an HTML help system, which views HTML help files on a specified path. The path is stored in HELPPATH environment variable, if not specified, default path is \HELP on the drive which HELP is placed.
Partially equivalent to the Unix command man
Manual page (Unix)
Man pages are the extensive documentation that comes preinstalled with almost all substantial Unix and Unix-like operating systems. The Unix command used to display them is man. Each page is a self-contained document.- Usage :...

.

intersvr & interlnk

(in MS-DOS; filelink in DR-DOS)
Network PCs using a null modem cable or LapLink cable
LapLink cable
A LapLink cable is a cable that allows one to connect two computers together to establish a direct cable connection. The connection is achieved via the parallel ports on the two computers. No networking hardware such as a network interface card or a modem are required...

. The server-side version of InterLnk, it also immobilizes the machine it's running on as it is an active app (As opposed to a TSR
Terminate and Stay Resident
Terminate and Stay Resident is a computer system call in DOS computer operating systems that returns control to the system as if the program has quit, but keeps the program in memory...

) which must be running for any transfer to take place. DR-DOS' filelink is executed on both the client and server.

New in PC DOS 5.02, MS-DOS 6.0
No direct Unix equivalent, though some Unices offer the ability to network computers with TCP/IP through null modem or Laplink cables using PLIP or SLIP
Slip
- In science and technology :* Slip , an aqueous suspension of minerals, and frequently deflocculant.* Slip , a positional displacement in a sequence of transmitted symbols...

.

join

Attaches a drive letter to a specified directory on another drive.


JOIN d: [d:\path]
JOIN [/D] (removes drive assignment)
If JOIN a: c:\floppy were executed, c:\floppy would display the contents of the a: drive. The opposite can be achieved via the subst command.

label
Label (command)
In computing, label is a command included with some operating systems . It is used to create, change, or delete a volume label on a logical drive, such as a hard disk partition or a floppy disk...

 

Changes the label on a logical drive, such as a hard disk partition or a floppy disk.
In Unix and Unix-like systems, this differs from filesystem to filesystem. e2label can be used for ext2 partitions.

loadfix 

Loads a program above the first 64K of memory, and runs the program.


loadfix [drive:][path]filename
Included only in MS-DOS/PC DOS. DR-DOS used memmax, which opened or closed lower, upper, and video memory access, to block the lower 64K of memory.

md or mkdir
Mkdir
The mkdir command in the Unix, DOS, OS/2 and Microsoft Windows operating systems is used to make a new directory. In DOS, OS/2 and Windows the command is often abbreviated to md.-Usage:Normal usage is as straightforward as follows:...

 

Makes a new directory
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

. The parent of the directory specified will be created if it does not already exist.


md directory
Equivalent to the Unix command mkdir.

mem

Displays memory usage.


mem

Options:
  • /CLASSIFY or /C - Lists the size of programs, provides a summary of memory in use and lists largest memory block available.
  • /DEBUG or /D - Displays status of programs, internal drivers, and other information.
  • /PROGRAM or /P Displays status of programs currently loaded in memory.

Equivalent to the Unix command free.

memmaker

Starting from version 6, MS-DOS included the external program MemMaker which was used to free system memory (especially Conventional memory
Conventional memory
In DOS memory management, conventional memory, also called base memory, is the first 640 kilobytes of the memory on IBM PC or compatible systems. It is the read-write memory usable by the operating system and application programs...

) by automatically reconfiguring the AUTOEXEC.BAT
AUTOEXEC.BAT
AUTOEXEC.BAT is a system file found originally on DOS-type operating systems. It is a plain-text batch file that is located in the root directory of the boot device...

 and CONFIG.SYS
CONFIG.SYS
CONFIG.SYS is the primary configuration file for the DOS, OS/2 as well as similar operating systems. It is a special file that contains setup or configuration instructions for the computer system.- Usage :...

 files. This was usually done by moving TSR Programs to the Upper memory
Upper Memory Area
In DOS memory management, the upper memory area refers to memory between the addresses of 640 KB and 1024 KB in an IBM PC or compatible. IBM reserved the uppermost 384 KB of the 8088 CPU's 1024 KB address space for ROM, RAM on peripherals, and memory-mapped input/output...

. The whole process required three system restarts. Before the first restart the user was asked whether he/she wanted to enable EMS Memory
Expanded memory
In DOS memory management, expanded memory is a system of bank switching introduced April 24, 1985 that provided additional memory to DOS programs beyond the limit of conventional memory. Expanded memory uses parts of the address space normally dedicated to communication with peripherals for program...

.

The use of MemMaker was popular among gamers who wanted to enable or disable Expanded memory
Expanded memory
In DOS memory management, expanded memory is a system of bank switching introduced April 24, 1985 that provided additional memory to DOS programs beyond the limit of conventional memory. Expanded memory uses parts of the address space normally dedicated to communication with peripherals for program...

 in order to run a game.


Options:
  • /BATCH Runs MemMaker in batch (unattended) mode. In batch mode, MemMaker takes the default action at all prompts.
  • /UNDO Instructs MemMaker to undo its most recent changes.

PC DOS uses another program RamBoost to optimize memory, either the HIMEM
HIMEM
HIMEM.SYS is a DOS device driver which allows DOS programs to store data in extended memory via the Extended Memory Specification . This device driver is of particular importance because various versions of Microsoft Windows that ran on top of the DOS operating system required HIMEM.SYS to be...

/EMM386
EMM386
The name EMM386 was used for the expanded memory managers of both Microsoft's MS-DOS and Digital Research's DR-DOS, which created expanded memory using extended memory on Intel 80386 CPUs. There also is an EMM386.EXE available in FreeDOS....

 or a third-party memory manager.

mode

Configures system devices. Changes graphics modes, adjusts keyboard settings, prepares code page
Code page
Code page is another term for character encoding. It consists of a table of values that describes the character set for a particular language. The term code page originated from IBM's EBCDIC-based mainframe systems, but many vendors use this term including Microsoft, SAP, and Oracle Corporation...

s, and sets up port redirection.

more 

Pages through the output so that you can view more than one screen of text.


command | more
Equivalent to the Unix commands more and less
Less (Unix)
less is a terminal pager program on Unix, Windows, and Unix-like systems used to view the contents of a text file one screen at a time. It is similar to more, but has the extended capability of allowing both forward and backward navigation through the file...

.

More may also be used as a filter
Filter (software)
A filter is a computer program to process a data stream. Some operating systems such as Unix are rich with filter programs. Even Windows has some simple filters built into its command shell, most of which have significant enhancements relative to the similar filter commands that were available in...

.


more < inputfilename

move
Move (command)
In computing, move is a command in various DOS, OS/2 and Microsoft Windows command line interpreters such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell. It is used to move one or more files or directories from one place to another. The original file is deleted, and the new file may have...

 

Moves files or renames directories.


move filename newname
move driveletter:\olddir driveletter:\newdir
Example of usage:

move c:\old c:\new
Equivalent to the Unix command mv
Mv
mv is a Unix command that moves one or more files or directories from one place to another. Since it can "move" files from one filename to another, it is also used to rename files. Using mv requires the user to have write permission for the directories which the file will move between...

. DR-DOS used a separate command for renaming directories, rendir.

msd

Provides detailed technical information about the computer's hardware and software.


msd
New in MS-DOS 6; the PC DOS version of this command is QCONFIG. The command appeared first in Word2, and then in Windows 3.10.

No Unix equivalent, however in GNU/Linux similar type of information may be obtained from various text files in /proc directory.

pause

Suspends processing of a batch program and displays the message 'Press any key to continue. . .'. This command exists in all versions of Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 and has the exact same function.

pcpark

Parks the hard disk heads in order to enable safe shutdown; only used on early versions.


pcpark
No Unix equivalent.

MS-DOS 3.2 (and possibly others) used the command HHSET

print
Print (command)
In computing, print is a command in the command line interpreters of DOS, OS/2 and Microsoft Windows. It is used to add a text file to the print queue...

 

Adds a file in the print queue.


Options:
  • /D device : Specifies the name of the print devices. Default value is LPT1
  • /P filename : Add files in the print queue
  • /T : Removes all files from the print queue
  • /C filename : Removes a file from the print queue


This command was introduced in MS-DOS version 2. Before that there was no built-in support for background printing files. The user would usually use the copy command to copy files to LPT1.

Equivalent to the Unix commands lp
Lp (Unix)
The lp command is used on many Unix-like systems to assign jobs to printer queues. The name derives from "lineprinter", though it has become the commonly used command for any sort of printer...

and lpr
Lpr
The lpr command is used on many Unix-like systems to assign jobs to printer queues. The name derives from "lineprinter", though it has become the commonly used command for any sort of printer...

.

readline

Reads a line from input, and sets the variables %1 to %9, as if the line had been set as batch parameters.


Use the READLINE command to read a line of text from the
keyboard and place it in the batch file variables to
This command can only be used from within a batch file.

SYNTAX: READLINE [/V]

where:
/V converts the input line to upper case.

The command occurs in the OS/2 command.com and cmd.exe, but not in other systems.

rd or rmdir
Rmdir
rmdir is a command which will remove an empty directory on a Unix, DOS, OS/2 or Microsoft Windows operating system. In Unix, Linux, and MacOS, it is case sensitive, whereas DOS, OS/2 and Windows , you can type the characters in any combination of upper case and lower case letters, and rd/rmdir...

 

Remove a directory (delete a directory), by default the directories must be empty of files for the command to succeed. The deltree command in some versions of MS-DOS and all versions of Windows 9x
Windows 9x
Windows 9x is a generic term referring to a series of Microsoft Windows computer operating systems produced since 1995, which were based on the original and later modified Windows 95 kernel...

 removes non-empty directories.


rmdir /s
The [/s] parameter enables rmdir to function in the same way as deltree, deleting all sub folders and Files, and by default requiring confirmation.


rmdir /s /q
The [/q] parameter, if present, tells the rmdir command to carry out the deletion without first prompting for confirmation. This is the same as running deltree [/y].

rem

Remark statement, normally used within a batch file
Batch file
In DOS, OS/2, and Microsoft Windows, batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter....

, and for DR-DOS, PC/MS-DOS 6 and above, in CONFIG.SYS.

The REM command is processed by the command processor, the output can be redirected to create a zero-byte file.


rem This creates a zero-byte file in some command processors.
rem > newfilename
:: This never creates a file
:: > filename.ext
REM is also useful in logged sessions or screen-captures.

One might add comments by way of labels, usually starting with double-colon ::. These are not processed by the command processor.

In Unix, the # sign can be used to start a comment.

ren
Ren (command)
In computing, ren is a command in various DOS, OS/2 and Microsoft Windows command line interpreters such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell. It is used to rename files and in some implementations also directories. It is analogous to the Unix mv command...

 

Renames a file. Unlike the move command, this command cannot be used to rename subdirectories, or rename files across drives.


ren filename newname
You can rename files in another directory by using the PATH parameter:


ren ath\]filename] [newfilename]
This example renames c:\windows\filex.txt to c:\windows\filey.txt


ren c:\Windows\filex.txt filey.txt
Using a path in the destination newname will move the file to the new path, if this is on the same device. This renames the file to the c:\temp directory.


ren c:\windows\filex.txt \temp\filey.txt
On DOS with long filename
Long filename
Long filenames , are Microsoft's way of implementing filenames longer than the 8.3 filename, or short-filename, naming scheme used in Microsoft DOS in their modern FAT and NTFS filesystems. Because these filenames can be longer than an 8.3 filename, they can be more descriptive...

 support, care must be taken when directories have spaces in their names like "Documents and Settings". In these cases double-quotes are used to enclose them. Note it is necessary only to enclose blocks including spaces.


ren c:\"Documents and Settings"\"All Users"\Desktop\filex.txt filey.txt
ren "c:\Documents and Settings\All Users\Desktop\filex.txt" filey.txt
Wildcards in the destination are replaced by the corresponding part of the original name, so the command below will change the extension of the file from .doc to .txt, here myfile.doc becomes myfile.txt.


ren myfile.doc *.txt
Mass renames can be accomplished by the use of wildcards. For example, the following command will change the extension of all files in the current directory which currently have the extension htm to html:


ren *.htm *.html
In Unix, this functionality of a simple move is provided by the mv
Mv
mv is a Unix command that moves one or more files or directories from one place to another. Since it can "move" files from one filename to another, it is also used to rename files. Using mv requires the user to have write permission for the directories which the file will move between...

command, while batch renames can be done using the rename command.

scandisk
SCANDISK
SCANDISK or ScanDisk is a utility in MS-DOS and Microsoft Windows systems which checks and repairs file systems and bad clusters on the hard drive. It was introduced in MS-DOS version 6.2...

 

Disk diagnostic utility. Scandisk was a replacement for the chkdsk utility, starting with later versions of MS-DOS. Its primary advantages over chkdsk is that it is more reliable and has the ability to run a surface scan which finds and marks bad clusters on the disk. It also provided mouse point-and-click TUI
Text user interface
TUI short for: Text User Interface or Textual User Interface , is a retronym that was coined sometime after the invention of graphical user interfaces, to distinguish them from text-based user interfaces...

, allowing for interactive session to complement command-line batch run.

chkdsk had surface scan and bad cluster detection functionality included, and was used again on Windows NT based operating systems.
Equivalent to the Unix command fsck
Fsck
The system utility fsck is a tool for checking the consistency of a file system in Unix and Unix-like operating systems such as Linux.-Use:...

.

set

Sets environmental variables. See Environment variable
Environment variable
Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.They can be said in some sense to create the operating environment in which a process runs...

.
CMD.EXE in Windows NT 2000, 4DOS, 4OS2, 4NT, and a number of third-party solutions allow direct entry of environment variables from the command prompt, in the manner of set /p.


set /p choice=Type your text.
echo You typed: "%choice%"

From at least Windows 2000, the set command with the /A switch allows the evaluation of strings into variables, thus providing inter alia a means of performing integer arithmetic.

setver

TSR designed to return a different value to the version of DOS that is running. This allows programs that look for a specific version of DOS to run under a different DOS.

Setver appeared in version 4, and has been in every version of DOS, OS/2 and Windows NT since.

share 

Installs support for file sharing and locking capabilities.


share [/F:space] [/L:locks]

/F:space Allocates file space (in bytes) for file-sharing information.
/L:locks Sets the number of files that can be locked at one time.

sort

A filter
Filter (software)
A filter is a computer program to process a data stream. Some operating systems such as Unix are rich with filter programs. Even Windows has some simple filters built into its command shell, most of which have significant enhancements relative to the similar filter commands that were available in...

 to sort lines in the input data stream and send them to the output data stream.


sort < inputfilename > outputfilename
Similar to the Unix command sort
Sort (Unix)
sort is a standard Unix command line program that prints the lines of its input or concatenation of all files listed in its argument list in sorted order. Sorting is done based on one or more sort keys extracted from each line of input. By default, the entire input is taken as sort key...

. Handles files up to 64k. This sort is always case insensitive.

subst
Subst
subst is a command on the DOS, IBM OS/2 and Microsoft Windows operating systems used for substituting paths on physical and logical drives as virtual drives...

 

A utility to map a subdirectory to a drive letter.


subst <d:> <path>
subst <d:> /D (Deletes the substitute drive)
If SUBST e: c:\edrive were executed, a new drive letter e: would be created, showing the contents of c:\edrive. The opposite can be achieved via the join command.

sys
Sys.com
SYS.COM is a component of DOS and Microsoft Windows 9x operating systems that will copy the command line shell , the boot loader , the kernel , and the boot sector to the corresponding drive, allowing the target drive to be bootable...

 

A utility to make a volume bootable. Sys rewrites the Volume Boot Code (the first sector of the partition that Sys is acting on) so that the code, when executed, will look for Io.sys. Sys also copies the core DOS system files, Io.sys, Msdos.sys, and Command.com, to the volume. Sys does NOT rewrite the Master Boot Record, contrary to widely-held belief.

time and date
Time and date
In computing, time and date are commands that are used to display and set the current time and date of the operating system. Both commands are available in DOS, OS/2 and Microsoft Windows command line interpreters such as COMMAND.COM, cmd.exe and 4DOS/4NT. The Unix command date displays both the...

 

Display and set the time and date


time
date
When these commands are called from the command line or a batch file, they will display the time or date and wait for the user to type a new time or date and press RETURN. The commands time /t and date /t will display output without waiting for input.

The Unix command date
Date (Unix)
The Unix date command displays the time and date. The super-user can use it to set the system clock.- Usage :With no options, the date command displays the current date and time, including the abbreviated day name, abbreviated month name, day of the month, the time separated by colons, the timezone...

displays both the time and date, but does not allow the normal users to change either. Users with superuser privileges may use date -s to change the time and date.

The Unix command time
Time (Unix)
time is a command in the Unix operating systems. It is used to determine the duration of execution of a particular command.-Usage:To use the command, simply precede any command by the word time, such as:time ls...

performs a different function.

tree

Shows the directory tree of the current directory

Syntax:

tree [options] [directory]
Options:
  • /F (Displays the names of the files in each folder.)
  • /A (Use ASCII instead of the extended characters.)
  • /? (Shows the help)


Note: Does not work on some computers with Windows 7 OS.

truename 

truename
or
truename drivename
or
truename filename
or
truename directory
If typed without a parameter then the current active drive pathname is displayed.

MS-DOS can find files and directories given their names, without full path information, if the search object is on a path specified by the environment variable PATH. For example, if PATH includes C:\PROGRAMS, and file MYPROG.EXE is on this directory, then if MYPROG is typed at the command prompt, the command processor will execute C:\PROGRAMS\MYPROG.EXE

the TRUENAME command will expand a name in an abbreviated form which the command processor can recognise into its full form, and display the result. It can see through SUBST and JOIN to find the actual directory. In the above example,
TRUENAME MYPROG
would display
C:\PROGRAMS\MYPROG.EXE

and for a substituted drive set up by
subst d: c:\util\test
the command
truename d:\test.exe
will display
c:\util\test\test.exe

This command also displays the UNC pathnames of mapped network or local CD drives.

This command is an undocumented DOS command. The help switch "/?" defines it as a "Reserved command name". It is available in MS-DOS 5.00.

This command is similar to the Unix which command, which, given an executable found in $PATH, would give a full path and name. The C library function realpath performs this function.


The Microsoft Windows command processors do not support this command.

type
Type (command)
In computing, type is a command in various VMS. AmigaDOS, CP/M, DOS, OS/2 and Microsoft Windows command line interpreters such as COMMAND.COM, cmd.exe, 4DOS/4NT and Windows PowerShell. It is used to display the contents of specified files...

 

Display a file. The more command is frequently used in conjunction with this command, e.g. type long-text-file | more.


type filename
Equivalent to the Unix command cat
Cat (Unix)
The cat command is a standard Unix program used to concatenate and display files. The name is from catenate, a synonym of concatenate.- Specification :...

. Note that you can use this to concatenate files (type file1 file2 > file3) however this won't work for large files--use copy command instead.

undelete
Undeletion
Undeletion is a feature for restoring computer files which have been removed from a file system by file deletion. Deleted data can be recovered on many file systems, but not all file systems provide an undeletion feature. Recovering data without an undeletion facility is usually called data...

 

Restores file previously deleted with del. By default all recoverable files in the working directory are restored. The options are used to change this behavior. if the MS-DOS mirror TSR program is used, then deletion tracking files are created and can be used by undelete.

Syntax:

undelete [filespec] [/list|/all][/dos|/dt]

Options:
  • /list : lists the files that can be undeleted.
  • /all : Recovers all deleted files without prompting. Uses a number sign for missing first character.
  • /dos : Recover only MS-DOS aware files, ignore deletion tracking file.
  • /dt : Recover only deletion tracking file aware files.

In Unix and Unix-like systems this differs from filesystem to filesystem. People who use the ext2
Ext2
The ext2 or second extended filesystem is a file system for the Linux kernel. It was initially designed by Rémy Card as a replacement for the extended file system ....

 filesystem can try the command e2undel.

ver
Ver (command)
In computing, ver is a command in various DOS, OS/2 and Microsoft Windows command line interpreters such as COMMAND.COM, cmd.exe and 4DOS/4NT. It prints the name and version of the operating system or the command shell...

 

An internal DOS command, that reports the DOS version presently running, and since MS-DOS 5, whether DOS is loaded high. The corresponding command to report the Windows version is winver.


Options: DOS 5 and later
  • /r : revision level, also shows whether DOS is loaded high
  • /? : shows command line help.


Value returned:
  • MS-DOS up to 6.22, typically derive the DOS version from the DOS kernel. This may be different from the string it prints when it starts.
  • PC DOS typically derive the version from an internal string in command.com (so PC DOS 6.1 command.com reports the version as 6.10, although the kernel version is 6.00.)
  • DR-DOS reports whatever value the environment variable OSVER reports.
  • OS/2 command.com reports an internal string, with the OS/2 version. The underlying kernel here is 5.00, but modified to report x0.xx (where x.xx is the OS/2 version).
  • Windows 9x command.com report a string from inside command.com. The build version (e.g. 2222), is also derived from there.
  • Windows NT command.com reports either the 32-bit processor string (4nt, cmd), or under some loads, MS-DOS 5.00.500, (for all builds). The underlying kernel reports 5.00 or 5.50 depending on the interrupt. MS-DOS 5.00 commands run unmodified on NT.
  • The Winver command usually displays a Windows dialog showing the version, with some information derived from the shell. In windows before Windows for workgroups 3.11, running winver from DOS reported an embedded string in winver.exe.

verify 

Enables or disables the feature to determine if files have been correctly written to disk.
If no parameter is provided, the command will display the current setting.


verify [on|off]

xcopy
XCOPY
In computing, Xcopy is a command used on PC DOS, MS-DOS, OS/2, Microsoft Windows, and related operating systems for copying multiple files or entire directory trees from one directory to another and for copying files across a network...

 

Copy entire directory trees.


Xcopy is a version of the copy command that can move files and directories from one location to another.

xcopy directory [destination-directory]
Equivalent to the Unix command cp
Cp (Unix)
cp is a UNIX command used to copy a file. Files can be copied either to the same directory or to a completely different directory, possibly on a different file system or hard disk drive. If the file is copied to the same directory, the new file must have a different name to the original; in all...

when used with -r parameter.

External links



There are several guides to DOS commands available that are licenced under the GNU Free Documentation License
GNU Free Documentation License
The GNU Free Documentation License is a copyleft license for free documentation, designed by the Free Software Foundation for the GNU Project. It is similar to the GNU General Public License, giving readers the rights to copy, redistribute, and modify a work and requires all copies and...

:
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK