List of DOS commands
From open-encyclopedia.com - the free encyclopedia.
A list of DOS commands for Microsoft's DOS operating system follows. Beginning with version 6.0, the user could get help by typing HELP in the shell prompt. Square brackets indicate optional parameters, while italicized items should be replaced with specific values.
In the list below, when a command can accept more than one filename, or a filename including wildcards (* and ?), it is said to accept a filespec parameter. Commands that can accept only a single filename are said to accept a filename parameter.
| Contents |
Commands
attrib
- Change or view the attributes of one or more files. It defaults to displaying the attributes of all files in the current directory.
Options:
- To add an attribute attach a '+' in front of it.
- To remove an attribute attach a '-' in front of it
- Attributes include
- A - Archived (used mainly by file archiving software)
- H - Hidden
- S - System
- R - Read-only
attrib [+|-ahrs] [filespec]
cd or chdir
- Change current directory.
cd directory
cls
- Clears the screen, except for the command prompt.
cls
copy
- 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.
copy filespec [destination]
del
- Deletes files.
del vikas
deltree
- 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
dir
Main article: Dir (DOS Command)
- Displays contents of a directory.
Options :
- /w : Wide list format
- /p : Pause at every page
- /s : Also look in subdirectories
- /a[xx] : Display files with the specified attributes only
- /o[xx] : Modifies sort order
dir [options] [filespec]
format
- Delete all the files on the disk and reformat it for MS-DOS
- In most cases, this should only be used on floppy drives or other removable media. This command can potentially erase everything on a computer's hard disk.
- /autotest is an undocumented feature. Adding it formats the drive without a confirmation prompt.
format [options] drive
InterLnk
- MS-DOS 6 and above command to network PCs using a null modem cable. See also: null-modem. InterLnk is the client-side program (InterSvr is the server) which mapped the drives of the machine running InterSvr to the local machine.
InterSvr
- MS-DOS 6 and above command used to network PCs using a null modem cable. The server-side version of InterLnk, it also immobilizes the machine it's running on as it's an active app (As opposed to a TSR) which must be running for any transfer to take place.
label
- Changes the label on a logical drive, such as a hard disk partition or a floppy disk.
label drive
md or mkdir
- Create a directory
md name
more
- Pages through the output so that you can view more than one screen of text.
command | more
move
- Moves a file.
move filename newfilename
pcpark
- Parks the hard disk(s) (stops their turning) in order to enable safe shutdown; only used on early versions.
pcpark
rd or rmdir
- Remove a directory, which must be empty of files.
rd directory
ren
- Renames a file.
ren filename newname
restart
- Restarts the computer, on many motherboards
restart
time and date
- Set/display the date and time
date time
tree
- Shows the directory tree of the current directory
- Options:
- /F (Displays the names of the files in each folder.)
- /A (Use ASCII instead of the extended characters.)
tree [options] [directory]
type
- Display a file. The more command is frequently used in conjunction with this command, e.g. type long-text-file | more.
type filename
ver
- Shows the version of MS-DOS you are using
- Some versions of MS-DOS support an undocumented /r switch, which will show the revision as well as the version.
ver [/r]
xcopy
- Copy entire directory trees.
xcopy directory [destination-directory]
External link
zh:MS-DOS命令列表