most of these MS DOS commandsAre OS Windows XP. It is very possible that some of them may not be available Windows Eyeglasses si Windows 7. You will notice in the list below that some of them end with /? BACKGAMMON. «/?» at the end of the command line, it will display the table with all the characteristics of the command.
A
addusers — Add or list users to/from a CSV file (XP Only)
ansi.sys — Defines functions that change display graphics, control cursor movement and reassign keys
at * — Enables users to schedule tasks to be performed at a specified time and date
append – Similar to the PATH MS-DOS command, the append command enables a user to open files in the specified directory as if they were in the current directory
appwiz.cpl — Launch, add or remove programs and windows components
arp – Displays, adds and removes arp information from network devices
Assoc – The assoc command displays the file association for each of the different file extensions on the computer
associat – One step file association
attrib – Attrib allows a user to change the properties of a specified file ie Read-only, Archived, Hiddenand System
B
Bootcfg.exe – The bootcfg command is a recovery console command that enables a user to rebuild, view, and otherwise make changes to the boot.ini file
browstat — Get domain, browser and PDC info
C
Cacls.exe – The cacls command enables a user to view and modify the ACLs of a file
call document — Calls one batch program from another without stopping the parent batch program
(Call /? TABLE)
certreq — Requests certificates from a certification authority (certreq /? TABLE)
certutil – Certutil.exe is a command-line program that is installed as part of Certificate Services (certutil /? TABLE)
chcp.exe – (Before the chcp command can be used, the nlsfunc must be loaded, as well as the country.sys must be loaded into the config.sys) The chcp command is used to supplement the International keyboard and character set information, allowing MS- DOS to be used in other countries and with different languages
cd & chdir — means to change the directory in MSDos (For example chdir \ & cd \ take you to the highest level of the drive, chdir .. & cd .. goes back one, etc)
chkdsk.exe – Chkdsk is a utility which checks the computer’s hard disk drives’ status for any cross-linked or any additional errors with the hard disk drive
chknfts.exe – The chkntfs command is used to display or modify the checking of the disk drive using NTFS at boot time
choice — This tool allows users to select one item from a list of choices and returns the index of the selected choice. (choice /? TABLE)
cipher.exe – Displays or alters the encryption of directories [files] on NTFS partition
(More commands such as Cipher / e, cipher / d, etc… Type one incorrctly to get the list… Use cipher / R)
clip – Redirects the output of command line tools to the windows clipboard. This text output can then be pasted into other programs. (clip /? TABLE) eg DIR | video
class — clears all that is written on a dos window
color — The color command enables users running Microsoft Windows 2000 and Windows XP to quickly and easily change the default color of their background and/or text in their MS-DOS window eg COLOR 0a
comp – A simple compare that compares two or more files TABLE BELOW:
data1 Specifies the location and name(s) of the first file(s) to compare.
data2 Specifies the location and name(s) of second files to compare.
/ D Displays differences in decimal format.
/ A Displays differences in ASCII characters.
/ L Displays line numbers for differences.
/N=number Compares only the first specified number of lines in each file.
/C Disregards case of ASCII letters when comparing files.
/ I MUST BE SELECTED IF YOU WANT TO COMPARE ANYTHING OTHER THAN SIZE
compact – Compact is an MS-DOS command used to compress, uncompress, and view compressed files TABLE BELOW:
/C Compresses the specified files. Directories will be marked so that files added afterwards will be compressed.
/U Uncompresses the specified files. Directories will be marked so that files added afterwards will not be compressed.
/S Performs the specified operation on files in the given directory and all subdirectories. Default «dir» is the current directory.
/A Displays files with the hidden or system attributes. These files are omitted by default.
/ I Continues performing the specified operation even after errors have occurred. By default, COMPACT stops when an error is encountered.
/F Forces the compress operation on all specified files, even those which are already compressed. Already-compressed files are skipped by default.
/ Q Reports only the most essential information.
filename Specifies a pattern, file, or directory.
convert — Convert FAT volumes to NTFS LIST BELOW:
volume Specifies the drive letter (followed by a colon), mount point, or volume name.
/ FS: NTFS Specifies that the volume to be converted to NTFS.
/V Specifies that Convert should be run in verbose mode.
copy — accomplished what ctrl+ c does, but in DOS
compmgmt.msc * — view and config system settings and components
cmd — Opens a command prompt window
control.exe system – View basic information about your computer system settings
CSVDE – Imports and exports data from Active Directory using files that store data in the comma-separated value (CSV) format. You can also support batch operations based on the standard CSV file format (CSVDE /? TABLE)
D
data — shows you that date (it wants you to input a «new» date)
dcgpofix – Restores the default Group Policy objects to their original state (that is, the default state after initial installation) (dcgpofix /? TABLE)
debugging – Debug is a method of looking at portions of your computer and writing assembly code to perform certain tasks on your compute example: debug C:\windows (press Q to exit debug)
defrag * — defrags the computer! (defrag /? TABLE) Note: you want to do this every month or so, or at least I do
dfscmd – Manages a distributed file system from the command line (dfscmd /? TABLE)
of the — used to delete files from the computer
deltree – Short for delete tree, deltree is a command used to delete files and directories permanently from the computer
dir – The dir command allows you to see the available files in the current and/or parent directories
disable — The disable command is a recovery console command that disables Windows system services or drivers EXAMPLE: disable SERVICE_AUTO_START
diskcomp – Compares the contents of a floppy disk in the source drive to the contents of a floppy disk in the target drive
diskcopy – The diskcopy utility allows a user to copy the complete contents of a diskette to another diskette. It is not recommended that the diskcopy command be used for anything but a floppy diskette. TABLE BELOW:
DISKCOPY [drive1: [drive2:]] [/1] [/V] [/M]
/1 Copies only the first side of the disk.
/ V Verifies that the information is copied correctly.
/ M Force multi-pass copy using memory only.
diskpart – The diskpart command is a recovery console command that enables a user to delete and create partitions on their computer
diskpart [/add | /delete] [device_name | drive_name | partition_name] [size]
/add Creates a new partition.
/ delete Deletes an existing partition.
device_name The device on which you want to create or delete a partition. The name can be obtained from the output of the map command.
drive_name The partition you want to delete, by drive letter. Used only with / delete.
partition_name The partition you want to delete, by partition name. Can be used in place of the drive_name. Used only with / delete.
size The size, in megabytes (MB), of the partition you want to create. Used only with /add.
doskey — Doskey is an MS-DOS utility that allows a user to keep a history of commands used on the computer. This allows frequently used commands to be used without having to type the commands at each time you need to use it TABLE BELOW:
/BUFSIZE:size Sets size of macro and command buffer (default:512)
/ECHO:on|off enables/disables echo of macro expansions (default:on)
/FILE:file Specifies file containing a list of macros
/ HISTORY Displays all commands stored in memory
/ INSERT Inserts new characters into line when typing
/KEYSIZE:size Sets size of keyboard type-ahead buffer (default:15)
/LINE:size Sets maximum size of line edit buffer (default:128)
/MACROS Displays all DOSKey macros
/OVERSTRIKE Overwrites new characters onto line when typing (default)
/REINSTALL Installin new copy of DOSKey
macroname Specifies a name for a macro you create
text Specifies commands you want to assign to the macro
driverquery – enables an admin to display a list of installed device drivers (driverquery /? TABLE)
E
threw out — Echo is used to repeat the text typed in back to the screen and / or can be used to echo to a peripheral on the computer, such as a COM port
edit – Edit allows a user to view, create, and/or modify their computer files (Use
edit /? The Get The Table)
Edlin – Edlin is an early version of the MS-DOS edit command. While not as easy as the edit command, edlin allows the user to crudely edit files (edit /? TABLE)
enable – The enable command is a recovery console command to enable a disabled service or driver eg enable SERVICE_SYSTEM_START
endlocal — Stops the localization of the environment changes enabled by the setlocal command (Use endlocal /? For full description)
Erase — Erase is a command used to remove files from your computer hard disk drive and or other writable media (Use erase /? for TABLE)
eventcreate — This commans line tool enables an admin to create a custom event ID and message in a specific event log. (eventcreate /? TABLE)
exit — two successes
expand — The expand command is use to take a compressed Windows file and «expand» it to its original format (Use expand /? for full TABLE)
extract — The Windows extract command is used to take files that are compressed in a Windows Cabinet file and place it into a specified location on the hard disk drive (Use extract /? for a bit O’ history provided at the bottom, as well as the TABLE)
eventvwr.exe — View monitoring and troubleshooting messages
F
FC — FC, or file compare, is used to compare two files against each other. Once completed, fc will return lines which differ between the two files. If no lines differ, you will receive a message indicating no differences encountered (Use FC /? for TABLE)
eg «fc c: \ autoexec.bat c: \ config.sys»
find — Allows you to search for text within a file. Although MS-DOS itself is not case sensitive, when typing in the string that you are looking for with the find command, it is case sensitive (Use find /? for TABLE)
findstr – The findstr command is short for find string and is a command used in MS-DOS to locate files containing a specific string of plain text (Use findsrt /? for TABLE)
eg findstr «computer help» myfile.txt
finger – Displays information about a user on a specified system running the Finger service. Output varies based on the remote system. (finger /?)
fixboot — The fixboot command is a recovery console command that creates a new partition boot sector; the fixboot command is only available when you are using the Recovery Console eg fixboot C:
FOR – The FOR variable is used for batch files to run a specified command when a parameter is met or specified (Use FOR /? for description)
FORFILES – selects a file (or set of files) and executes a command on that file, helpful for batch jobs. (forfiles /?)
format – Format is used to erase all of the information off of a computer diskette or fixed drive eg format a: would erase all the contents off a disk. Commonly used on a diskette that has not been formatted or on a diskette you wish to erase (Use format /?
don’t be an idiot and type format C: and follow throught with it, this will delete everything off of your C: wich, by deafult, is your main drive).
fsutil – Fsutil is a command-line utility that you can use to perform many tasks related to file allocation table (FAT) and NTFS file systems, such as managing reparse points, managing sparse files, or dismounting a volume (fsutil /? TABLE)
ftp – FTP is short for File Transfer Protocol, this page contains additional information about the FTP command and help using that command in Unix and MS-DOS
(Use FTP /?)
ftype – Displays or modifies file types used in file extension associations (fytpe /?)
G
getmac – This tool enables an admin to display the MAC address for the network adapters on a system (getmac /? TABLE)
goth – Moves a batch file to a specific label or location, enabling a user to rerun a batch file or skip other lines depending on user inputs or events (Use goto /?)
gpedit.msc. The local Group Policy editor appears on the screen, enabling you to adjust policies that affect the local machine
GPResult — This command line tool displays the Resultant Set of Policy (RSoP) info for a target user or computer (gpresult /? TABLE)
gpupdate — Refreshes the local computers policy and any Active Directory-based Group policies (Use gpupdate /? for TABLE.
graftabl – Graftabl command allows the display to show extended characters in graphics mode from a specific code page. Most monitors do not need the graftabl command to be loaded (Use graftabl /? for TABLE)
H
help — accomplished what /? does eg Help cls
hostname – Display the hostname of the machine the command is being run on
I
IF – Allows for batch files to perform conditional processing (IF /? for TABLE)
inetcpl.cpl – View Internet explorer settings
ipconfig.exe – View and configure network address settings (Use ipconfig.exe /all for advanced options)
K
keyb – Keyb is used to change the layout of the keyboard used for different countries (not supported with XP or VISTA; NT, 98, 95 only)
L
label – Label is used to view or change the label of the computer disk drives (label /?
eg label a: mydisk)
loadfix — Loads a program above the first 64K of memory, and runs the program
(Loadfix /? Forum TABLE) loadfix eg C: \ Mouse \ Mouse.com
Lock / Unlock command – LOCK allows a user to lock a drive, enabling direct disk access for an application. UNLOCK allows a user to unlock a drive, disabling direct disk access for an application (Win 98 & 95 ONLY)
lodctr — Updates registry values related to preformance counters (lodctr /? TABLE)
logoff – The logoff command is an external command that allows a user to quickly logoff their computer from the command line or within a batch file (Note: does not prompt you)
logon – The logon command is a recovery console command that lists the installations of Windows 2000 / Windows XP and requests the local administrator password for those installations
Logman – Manages and schedules performance counter and event trace log collections on local and remote systems (logman /? TABLE)
M
map — The map command is a recovery console command that displays the physical device name of a drive letter
Member — Allows you to determine the available, used and free memory (mem /? TABLE)
md / mkdir — Allows you to create your own directories in MS-DOS eg md test example creates the «test» directory in the directory you are currently in and md C: \ test Creates the «test» directory in the c: \ directory (md / ? BACKGAMMON)
Fashion – Mode status is used to view and/or modify a port or display setting
(mode /? TABLE)
more — More allows information to be displayed one page at a time (more /? TABLE)
i mean | more and more myfile.txt
mountvol — Creates, deletes, or lists a volume mount point (mountvol /? TABLE)
move – Allows you to move files or directories from one folder to another, or from one drive to another (more /? TABLE) eg move c:\windows\temp\*.* c:\temp
mscdex — Mscdex is a CD-ROM «redirector» that enables CD-ROM access from the MS-DOS
msinfo32.exe – displays advanced information about hardware and software settings
msra.exe — Receve help from (or offer help to) a friend over the internet
N
NET — The net command is used to update, fix, or view the network or network settings
(Net /? TABLE) eg net view \\ hope and net localgroup
netsh – MS-DOS command that enables users to change network settings such as changing their network device from a dynamic address to a static address or changing the IP address (netsh /? TABLE) eg netsh dump (don’t be stupid and hit enter)
netstat — The netstat command is used to display the TCP / IP network protocol statistics and information (netstat /? TABLE) eg netstat -ban
nlsfunc — Used to load country specific information (nlsfunc /? TABLE) eg Below:
nlsfunc a: \ lang \ Spain.dat (don’t unless you’re fluent in spanish)
nslookup – MS-DOS utility that enables a user to look up an IP address of a domain or host on a network (nslookup /? TABLE) Notes: type ‘quit’ to stop nslookup
O
openfiles — Enables an admin to lose or disconnect files and folders that have been opened on a system (openfiles /? TABLE)
P
path — Path is used to specify the location where MS-DOS looks when using a command
(path /? TABLE) eg path=c:\windows\command
PathPing — Similar to the tracert command, pathping provides users with the ability of locating spots that have network latency and network loss (pathping /? TABLE)
PathPing eg trapped.com
pause – The pause command is used within a computer batch file and allows the computer to pause the currently running batch file until the user presses any key
perfmon.exe * – Monitor the reliability and performance of local or remote computers (Use preform.exe /report for advanced settings)
ping – Helps in determining TCP/IP Networks IP address as well as determine issues with the network and assists in resolving them (ping /? TABLE) eg ping localhost
popd — Changes to the directory or network path stored by the pushd command
(Popd /? TABLE)
powercfg – This command line tool enables users to control the power settings on a system (powercgf /? TABLE)
print – This command allowed users to print a text file to a line printer, in the background (print /? TABLE) eg print C:\file.txt /c /d:lpt1
prompt — Allows you to change the MS-DOS prompt to display more or less information
(Prompt /? TABLE MUST USE!)
pushd — Stores a directory or network path in memory so it can be returned to at any time (pushd /? TABLE) eg pushd ..
R
rasdial — not sure actually, but rasdial /? provides some info and a link that you can use for more information.
rd / rmdir — Removes empty directories in MS-DOS eg
Row C: \ users \ John_smith \ appdata \ temp \ av19023
recover – Recovers readable info from a bad or defective disk (recover /? TABLE)
reg — Command line registry tool that enables you to change, display, update, and otherwise manipulate the registry from the prompt (reg /? TABLE)
regedit32.exe * — Makes changes to the Windows registry.
rem – Records comments (remarks) in a batch file or CONFIG.SYS (rem /? TABLE)
ren / rename – Used to rename files and directories from the original name to a new name
(Ren /? TABLE) eg ren c: \ Chop hope
relog – Relog creates new performance logs from data in existing performance logs by changing the sampling rate and/or converting the file formats. Supports all performance log formats, including Windows NT 4.0 compressed logs. (clock /? TABLE)
replace – Replaces files (replace /? TABLE)
road. — Use the command to manually configure the routes in the routing table (route /? TABLE)
rstrui.exe * — restore your computer system to an earlier state
runas — Enables a user to execute a program on another computer as yourself or as another user (runas /? TABLE)
S
scandisk — Scandisk is designed to check the integrity of a computer hard disk drive to verify that there are no significant issues which could cause issues with your computer data (scandisk /? TABLE) eg scandisk /all
SC — SC is a command line program used for communicating with the Service Control Manager and services. (SC /? TABLE)
scanreg — Using Scanreg a user can backup his or her registry manually and or allow Windows to backup the registry daily (default) FOR WINDOWS 98 AND ME
secedit – Configures and analyzes system security by comparing your current configuration to at least one template (secedit /? TABLE)
set — Allows you to change one variable or string to another (set /? GIANT TABLE)
eg set path=c:windows\command
setlocal — Enables local environments to be changed without affecting anything else
(Setlocal /? TABLE)
setver — For setver to work, setver.exe device must be loaded in the config.sys.Setver is used to imitate the version of DOS in case an application was unable to run because of a newer version of MS-DOS. (setver /? TABLE) eg setver 4.01
SETX – Setx creates or modifies environment variables in the user or system environment. Can set variables based on arguments, regkeys, or file input (setx /? TABLE)
sfc — Scans and replaces any Microsoft Windows file on the computer and replaces any changed file with the correct version (sfc /? TABLE) eg sfc /scannow
share — Installs support for file sharing and locking capabilities (share /? TABLE)
shift — Changes the position of replaceable parameters in a batch program (shift /? BACKGAMMON)
shutdown — Enables a user to shutdown a Windows XP computer from the command line as well as perform additional features that are not available through Windows
(Shutdown /? Force cool features)
Black — Sorts the input and displays the output to the screen (sort /? TABLE)
sort eg test.txt
start — Enables a user to start a separate window in Windows from the MS-DOS prompt
(Start /? GIANT TABLE)
subst — Allows you to substitute a folder on your computer for another drive letter
(Subst /? TABLE) substances eg:.
systeminfo – Displays complete system information (XP Professional and Vista ONLY)
(systeminfo /? TABLE)
systemroot – The systemroot command is a recovery console command that sets the current directory as the system root directory (Win 2000 and XP only)
T
takeown – This tool allows an admin to recover access to a file that was denied by re-assigning file ownership (takeown /? TABLE)
taskmgr.exe — Views details about programs and processes running on your computer
taskkill — Allows user to kill a task from an MS-DOS prompt. (XP Pro and Vista ONLY)
(Taskkill /? TABLE) eg taskkill / f / im notepad.exe
tasklist – This tool displays a list of currently running processes on either a local or remote machine. (tasklist /? TABLE)
telnet — Enables a user to telnet to another computer from the command prompt (telnet /? TABLE) eg telnet myhost.com
team — Allows the user to view and edit the computer’s time
timeout — Pauses the command processor for the specified number of seconds (timeout /? TABLE)
tracert — The tracert command is used to visually see a network packet being sent and received and the amount of hops required for that packet to get to its destination
(Tracert /? TABLE)
tracerpt – Processes event trace logs or real-time data from instrumented event trace providers and allows you to generate trace analysis reports and CSV (comma-delimited) files for the events generated (tracerpt /? TABLE)
tree — Allows the user to view a list of files and folders in an easy to read listing (tree /? TABLE)
type – Allows the user to see the contents of a file (Type /? TABLE) eg type c:\autoexec.bat
typeperf – Writes performance counter data to the command window, or to a supported log file format. To stop Typeperf, press CTRL+ C (typeperf /? TABLE)
V
see — Displays the version of MS-DOS or if running Windows 95 or above the version of Windows
verify – Enables or disables the feature to determine if files have been written properly (verify on or verify off)
vol — Displays the volume information about the designated drive eg vol c:
vssadmin – Displays current volume shadow copy backups and all installed shadow copy writers and providers in the command window
W
W32tm — A tool used to diagnose problems occuring with Windows Time (W32tm /? TABLE)
waitfor — Synchronizes multiple computers across a network by using signals (waitfor /? TABLE)
Where – Locates and displays all of the files that match the given parameter. By default, the search is done in the current directory and in the PATH environment variable (where /? TABLE)
whoami — Returns domain name, computer name, user name, group names, logon identifier, and privileges for the user who is currently logged on (whoami /? TABLE)
winver.exe — displays info about MS OS
wscui.cpl — View and configure the security essentials for your computer
X
xcopy – Xcopy is a powerful version of the copy command with additional features; has the capability of moving files, directories, and even whole drives from one location to another (xcopy /? TABLE) eg xcopy c:\temp /e
Orders can be launched from Run or Command Prompt.
Changes ‘prompt’ (display such as ‘C:\>’) for the prompt window.
Syntax
prompt [<string>]
set prompt[=<string>]
Options
<string> | Specifies a string. For how to specify, please see Details and Samples. If omitted, the system default setting is applied. |
[Windows NT] To see the current setting, use the second syntax (Set statement) without ‘=’ and following strings.
[MS-DOS, Windows 95/98/Me] To see the current setting, type ‘echo %PROMPT%
’.
Details
About Prompt
In MS-DOS Prompt/Command Prompt, ‘Prompt’ command changes the ‘prompt’, which is a message that prompts for input. Usually this setting is ‘the current drive and path’ + ‘greater-than sign (>)’, such as ‘C:\path>’, and is based on:
prompt $p$g
‘$p’ means ‘the current drive and path’ and ‘$g’ means ‘a greater-than sign (>)’.
The characters that can be specified for Prompt are all characters that can be used on the command line. Characters that cannot be used on the command line and additional information such as the current path can be specified with special codes beginning with ‘$’ (see Special codes available in Prompt).
In batch files, in most cases the batch programs suppress command line output by putting ‘echo off’ at head, but conversely by putting ‘echo on’ the programs can output commands to be executed (useful for debugging/testing). In this case, usual Prompt setting may make noisy output, such as when the current path is long. To avoid this, you can use Prompt command to change the Prompt setting to adjust output format.
Since Prompt exists as an environment variable, Prompt can be set with Set command. On the other hand, if Prompt is changed in batch programs, its change remains in the current environment (session) like environment variables.
[MS-DOS, Windows 95/98/Me] To use common Prompt setting for all MS-DOS Prompts, add Prompt command to Autoexec.bat. For Windows Me, use the syntax with Set command (the behavior not using Set is unconfirmed).
[Windows NT] To use common Prompt setting for all Command Prompts, add ‘PROMPT’ setting to environment variables settings in Advanced system settings.
[Windows NT] The Prompt setting is subject to ‘localization’ by Setlocal and Endlocal. If changing the Prompt setting after Setlocal and then executing Endlocal or exiting the batch program, the Prompt setting is restored to the one before calling Setlocal.
If the string parameter is omitted, the default setting (following setting) is used.
[MS-DOS, Windows 95/98/Me] The default setting is ‘$n$g’.
[Windows NT?] The default setting is ‘$p$g’.
Special codes available in Prompt
All characters below are case insensitive.
$a | [Windows XP or later] Represents an ampersand ‘&’. (In [MS-DOS, Windows 95/98/Me] use ‘&’ directly.) |
---|---|
$b | Represents a pipe symbol ‘|’. (This character cannot be used directly unless using ‘^’.) |
$c | [Windows XP or later] Represents a opening parenthesis ‘(’. (In [MS-DOS, Windows 95/98/Me] use ‘(’ directly.) |
$d | Represents the current date. The date format depends on the current system locale. |
$e | Represents an escape character (ASCII code 27, \x1b). In MS-DOS Prompt with ANSI.SYS installed or in Command Prompt, the Prompt setting can be colored or etc. by using escape sequences. |
$f | [Windows XP or later] Represents a closing parenthesis ‘)’. (In [MS-DOS, Windows 95/98/Me] use ‘)’ directly.) |
$g | Represents a greater-than sign ‘>’. (This character cannot be used directly unless using ‘^’.) |
$h | Represents a backspace. If a backspace is included, a character immediately before the backspace will be deleted. |
$l | Represents a less-than sign ‘<’. (This character cannot be used directly unless using ‘^’.) |
$n | Represents the current drive letter. |
$p | Represents the current drive and path. |
$q | Represents a equal sign ‘=’. (This character is not recognized if in the head of Prompt command parameter (except when using Set).) |
$s | [Windows XP or later] Represents a space character. (Space characters can be used directly. In [MS-DOS, Windows 95/98/Me] use spaces directly.) |
$t | Represents the current time. This displays the time including the hundredth of a second. |
$v | Represents the MS-DOS or Windows version. |
$_ | Represents a newline (CR+LF). |
$$ | Represents a dollar sign ‘$’. |
$+ | [Windows NT series?/XP or later] [Extensions] Expands to ‘+’ symbols according to the number of Pushd execution (stack count). For example, when Pushd is called twice, ‘$+’ will be replaced with ‘++’. |
$m | [Windows NT series?/XP or later] [Extensions] Expands to the share name (network path) associated to the current drive if the current drive is a network drive. If not a network drive, ‘$m’ will be replaced with an empty string. |
Samples
All the samples below assume the current directory is ‘C:\foo\bar’. And, the tail ‘_’ character indicates the cursor.
Sample 1
prompt [$d $t] $n$g
By executing this, the prompt will be as follows:
[2010/01/01 01:23:45.67] C>_
If you don’t want to display to 1/100th of a second, you can eliminate by using three backspaces ($h) like this:
prompt [$d $t$h$h$h] $n$g
By executing this, the prompt will be as follows:
[2010/01/01 01:23:45] C>_
Sample 2
set prompt=The current directory is $p .$_$g
By executing this, the prompt will be as follows:
The current directory is C:\foo\bar . >_
Since ‘$_’ means a newline, the characters following ‘$_’ will be displayed on the second line.
Sample 3
prompt [%USERNAME%@%COMPUTERNAME% $p]$$$s
[Windows NT] By executing this, the prompt will be changed to the style like following:
[user@computer C:\foo\bar]$ _
In this case, ‘$s’ can be replaced with a space character directly.
Sample 4 (Batch file)
* In the sample below there is a space immediately after ‘+’ on line 4.
@echo off set OLD_PROMPT=%PROMPT% if "%DEBUG_MODE%"=="" goto Main prompt + echo on :Main MyCheck.exe /list %LIST_FILE% if errorlevel 1 goto Finish MyBackup.exe /list %LIST_FILE% :Finish @prompt %OLD_PROMPT% @set OLD_PROMPT=
This batch file executes ‘MyCheck.exe’ and ‘MyBackup.exe’, but when the environment variable ‘DEBUG_MODE’ has some value, this batch calls ‘echo on’ to print commands to be executed. In that case, the batch uses Prompt command to set the prefix character of output command to ‘+ ’.
Changed Prompt setting remains after the batch program exits, so the program keeps the old setting to ‘OLD_PROMPT’ and restores at the end. (Since ‘PROMPT’ is available as an environment variable, it can be written as ‘set OLD_PROMPT=%PROMPT%’.)
[Windows NT/2000/XP or later] By using Setlocal it is not necessary to keep the setting to ‘OLD_PROMPT’.
* In ‘echo on’ mode the output of command lines (and preceding characters based on Prompt setting) always follows a newline. This newline cannot be eliminated by Prompt command.
* [MS-DOS, Windows 95/98/Me only] An empty line is treated as a command line, resulting that in ‘echo on’ mode only a string based on Prompt setting will be printed when reaching an empty line. To suppress this, remove empty lines or put ‘@’ character only to the line.
Introduction to basic DOS command prompt use.
Windows 9x/2000/XP/Vista UNSUPPORTED |
NOTE: Windows 95/98, Windows Me, Windows 2000, Windows XP, and Windows Vista are no longer supported by the Help Desk. We can only provide best effort support. If we are unable to resolve your Windows 9x/2000/XP/Vista issue, you may be able to find help in Microsoft’s Knowledge Base. These products are no longer actively supported by Microsoft. No further development will take place on these products and security updates are no longer issued. It is highly recommended that you upgrade to Windows 10 or 8. |
Summary
DOS (Disk Operating System) was the first widely-installed operating system for IBM-compatible personal computers. DOS is a non-graphical line-oriented command-driven computer operating system. It has a relatively simple—but not overly «friendly»—user interface.
The earliest versions of the Microsoft Windows operating system were really just applications that ran on top of the MS-DOS operating system. Modern versions of Windows (Windows 95 and greater) no longer run on top of DOS, but do retain a DOS-like user interface called the «MS-DOS Prompt» or «Command Prompt». The command prompt allows Windows users to issue DOS commands to the system.
DOS commands are useful to Windows users for a variety of reasons. Many tasks that can be performed in the Windows graphical environment can be performed much more quickly and efficiently by utilizing DOS commands. Also, most bootable floppy disks will boot the system directly to a DOS environment.
Description
Users of any Windows system can invoke a command prompt by performing the following steps:
- Click Start.
- Select Run.
- In the «Open:» field, type command.
- Click OK.
A command prompt window is generally white or gray text on a black background. The prompt itself usually takes the following form:
X:\PATH>
where «X» represents the letter of the active drive, and «PATH» refers to the present working directory. Here’s an example of how a DOS command prompt commonly looks:
C:\Windows>_
Commands are typed and echoed to the screen at the cursor’s location. Usually commands consist of a keyword, followed by optional flags, followed by a path. More will be explained about syntax and additional flags under each specific command.
Click on a command to receive more information about it.
Important Information
- Note: Some of these commands can cause damage to your system if used improperly. Please use with caution. Files that are deleted with DOS Commands are permanently deleted.
- Some of these commands will not work with Windows NT, 2000, XP or with certain boot disks.
- Quick reference information for any of the following commands can be displayed by adding the /? flag after the command. (i.e. dir /? will display information about the syntax and options of the DIR command).
- Any of the flags or paths listed in square brackets-[] are optional—all others are required.
- The *(asterisk) character is used as a wildcard in DOS. For example, *.txt refers to all files that have the extension «txt». *.* refers to all files in the current directory.
- Note: Windows supports long filenames and allows spaces in file names. DOS does not, so when a filename is longer than 8 characters, DOS will truncate the file name to an abbreviated form that is 8 characters long. For example, the folder «Program Files» is displayed in DOS as «Progra~1».
- If a command cannot be found, it may be because the command is not in the DOS path. The path refers to the directories in which DOS will look for commands. Typing path at a DOS prompt will display the current DOS path. A new path can be defined by typing the command Path [directories], where [directories] refers to the series of directories for the path. Directory names should be separated by the «;» character.
Back to Menu of Commands
DIR
Displays a list of files and subdirectories in a directory.
SYNTAX
DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]] [/O[[:]sortorder]] [/S] [/B] [/L] [/V]
- [drive:][path][filename] Specifies drive, directory, and/or files to list.
- /P Pauses after each screenful of information.
- /W Uses wide list format.
- /A displays only files with these attributes:
- D Directories
- R Read-only files
- H Hidden files
- A Files ready for archiving
- S System files
- — Prefix meaning not: can be added to above attributes
- /O List by files in sorted order, sortorder:
- N By name (alphabetic)
- S By size (smallest first)
- E By extension (alphabetic)
- D By date & time (earliest first)
- G Group directories first
- A By Last Access Date (earliest first)
- — Prefix to reverse order: put in front of above
- /S Displays files in specified directory and all subdirectories.
- /B Uses bare format (no heading information or summary).
- /L Uses lowercase.
- /V Verbose mode.
EXAMPLES
dir
- — Lists all files and directories in the directory that you are currently in.
dir /s
- — Lists the files in the directory that you are in and all sub directories after that directory.
dir /p
- — If the directory has a lot of files and you cannot read all the files you can use this command and it will display all files one page at a time.
dir /w
- — Lists just the files and directories, going horizontal, and taking as little as space needed.
dir /a:-s
- — This would list all the files that aren’t system files in the current directory.
Back to Menu of Commands
CD
Changes the current directory
SYNTAX
- CD [drive:][path]
- CD[..]
EXAMPLES
cd \
- — Changes current directory to the highest level of the current drive (the root directory).
cd ..
- — Goes up one directory. For example if you are within the
C:\WINDOWS\COMMAND>
- directory this would take you to
C:\WINDOWS>
cd windows
- — Changes to the
Windows
- subdirectory of the current directory (if it exists).
Note: If you want to change to a different drive, CD will not switch to it. CD only changes directories in the current drive. To change drives, type the drive letter followed by a colon. i.e. cd d: will not switch to the d drive, but d: will switch drives.Back to Menu of Commands
COPY
Copies one or more files to another location.
See note on DOS vs. Windows file names above. If trying to copy files longer the 8 characters, DOS will truncate them with normal COPY. Also COPY will not move all files, it will leave Hidden and System files alone. Use XCOPY instead to solve both of these issues.
SYNTAX
COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ …]] [destination] [/A | /B]] [/V] [/Y | /-Y]
- source Specifies the file or files to be copied.
- /A Indicates an ASCII text file.
- /B Indicates a binary file.
- destination Specifies the directory and/or filename for the new file(s).
- /V Verifies that new files are written correctly.
- /Y Suppresses prompting to confirm you want to overwrite an existing destination file.
- /-Y Causes prompting to confirm you want to overwrite an existing destination file.
To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).
EXAMPLES
copy *.* a:
- — This would copy all files in the current directory to the floppy disk in drive a:
copy autoexec.bat c:\windows
- — Copies
autoexec.bat
- from the current directory to the
Windows
- directory of the C: drive.
copy file1.txt+file2.txt+file3.txt newfile.txt /v
- — This would add together (concatenate)
file1.txt, file2.txt
- and
file3.txt
- and store the results in
newfile.txt
- , then verify that it copied correctly.
Back to Menu of Commands
DELETE
Deletes one or more files.
SYNTAX
DEL [drive:][path]filename [/P]
- [drive:][path]filename — Specifies the file(s) to delete. Specify multiple files by using wildcards.
- /P — Prompts for confirmation before deleting each file.
EXAMPLES
del test.tmp
- — Deletes
test.tmp
- from the directory you are currently in (if it exists).
del c:\windows\test.tmp
- — Deletes
test.tmp
- from the
C:\Windows
- directory (if it exists).
del c:\windows\temp\*.* /P
- — Deletes all files in the
C:\Windows\temp
- directory, and requires confirmation for each file.
Back to Menu of Commands
XCOPY
Xcopy is a powerful version of the copy command with additional features. It has the ability to move files, directories and even whole drives from one destination to another. It also can preserve file attributes and long file names.
Note: XCOPY is in all versions of Windows, but may not run unless it is located in the command Path. Please see the note on Paths above. The actual file is called xcopy.exe and is located on Windows 98 and ME in the C:\Windows\Command directory on Windows NT and 2000 in the C:\Winnt\system32 and on Windows XP in the C:\Windows\system32 directory.
SYNTAX
XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/W] [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U] [/K] [/N]
- source — Specifies the file(s) to copy.
- destination — Specifies the location and/or name of new files.
- /A — Copies files with the archive attribute set, doesn’t change the attribute.
- /M — Copies files with the archive attribute set, turns off the archive attribute.
- /D:date — Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.
- /P Prompts you before creating each destination file.
- /S Copies directories and subdirectories except empty ones.
- /E Copies directories and subdirectories, including empty ones.
- /W Prompts you to press a key before copying.
- /C Continues copying even if errors occur.
- /I If destination does not exist and copying more than one file, assumes that destination must be a directory.
- /Q Does not display file names while copying.
- /F Displays full source and destination file names while copying.
- /L Displays files that would be copied.
- /H Copies hidden and system files also.
- /R Overwrites read-only files.
- /T Creates directory structure, but does not copy files. Does not include empty directories or sub directories. /T /E includes empty directories and sub directories.
- /U Updates the files that already exist in destination.
- /K Copies attributes. Normal xcopy will reset read-only attributes.
- /Y Overwrites existing files without prompting.
- /-Y Prompts you before overwriting existing files.
- /N Copy using the generated short names.
EXAMPLES
xcopy h:\*.* /a /e /k
- — Copies everything located on the H drive to the current drive.
xcopy c:\windows\desktop c:\desktop /a /e /f /h /k
- — Copies all files and folders in the
C:\Windows\Desktop
- folder to the
C:\Desktop
- folder.
Back to Menu of Commands
DELTREE
Deletes a directory and all the subdirectories and files in it.
Note: DELTREE is in all versions of Windows with the exception of Windows NT, 2000 and XP, but may not run unless it is located in the command path. Please see the note on Paths above. The actual file is called deltree.exe and is located in the C:\Windows\Command directory.
SYNTAX
DELTREE [/Y] [drive:]path [[drive:]path[…]]
- /Y — Suppresses prompting to confirm you want to delete the subdirectory.
- [drive:]path — Specifies the name of the directory you want to delete. More then one path can be specified.
Note: Use DELTREE cautiously. Every file and subdirectory within the specified directory will be deleted. Once deleted you cannot recover the information.
EXAMPLES
deltree c:\windows\fake010
- = Deletes the
fake010
- directory and everything in it.
Back to Menu of Commands
MOVE
Moves files and renames files and directories.
SYNTAX
To move one or more files: MOVE [/Y | /-Y] [drive:][path]filename1[,…]destination
To rename a directory: MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2 [drive:][path]
- [drive:][path]filename1 — Specifies the location and name of the file or files you want to move. (Multiple files separated by a comma)
- [drive:][path]Destination — Specifies the new location of the file. Destination can consist of a drive letter and colon, a directory name, or a combination.
- [drive:][path]dirname1 — Specifies the directory you want to rename.
- dirname2 [drive:][path] — Specifies the new name of the directory.
- /Y — Suppresses prompting to confirm creation of a directory or overwriting of the destination.
- /-Y Causes prompting to confirm creation of a directory or overwriting of the destination.
EXAMPLES
move c:\windows\temp\*.* c:\temp
- — Moves all files from the
C:\Windows\temp
- folder to the
C:\temp
- folder.
move /Y c:\temp temp2
- — Moves the
C:\temp
- directory and all contents to the
C:\temp2
- directory and suppress confirmation.
Back to Menu of Commands
REN
Renames a file/directory or files/directories.
SYNTAX
REN [drive:][path][directoryname1 | filename1] [directoryname2 | filename2]
Note: you cannot specify a new drive or path for your destination. You can only rename files in the same directory
- [drive:][path]filename1 — is the source file to rename.
- [drive:][path]directoryname1 — is the source directory to rename.
- filename2 — is the new name of the file.
- directoryname2 — is the new name of the file.
EXAMPLES
ren c:\chope hope
- — Rename the directory
chope
- to
hope
- .
ren *.txt *.bak
- — Rename all text files to files with .bak extension.
ren * 1_*
- — Rename all files to begin with 1_. The asterisk (*) in this example is a wild character this means all files.
Back to Menu of Commands
MKDIR
Creates a directory.
SYNTAX
- MKDIR [drive:]path
- MD [drive:]path
EXAMPLES
md test
- — Creates a directory called
test
- inside the current directory.
Back to Menu of Commands
RMDIR
Removes (deletes) a directory.
SYNTAX
- RMDIR [drive:]path RD [drive:]path
EXAMPLESrmdir c:\test
- — Removes the
test
- directory if empty.
Back to Menu of Commands
ATTRIB
Displays or changes file attributes such as read only, hidden, system, and archive. Attrib is necessary to use most other commands that do not work when some of these attributes are set.
Note: ATTRIB is in all versions of Windows, but may not run unless it is located in the command Path. Please see the note on Paths above. The actual file is called attrib.exe and is located on Windows 98 and ME in the C:\Windows\Command directory on Windows NT and 2000 in the C:\Winnt\system32 and on Windows XP in the C:\Windows\system32 directory.
SYNTAX
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.
EXAMPLES
attrib autoexec.bat
- — Show the attributes of the
autoexec.bat
- file.
attrib +r autoexec.bat
- — Makes the
autoexec.bat
- so it cannot be modified until the read only attribute is taken off.
attrib +h config.sys
- — Hides
config.sys
- from a normal directory listing. However, hidden files are always visible to the attrib command.
attrib -h config.sys
- — This command does the opposite of the above command. Instead of hiding the file it will unhide it if currently hidden.
Back to Menu of Commands
PING
Ping is used to determine if a connection exists between your computer, and another computer connected via TCP/IP. It sends small packets of information to the other computer, which are returned if the connection is found, and lost otherwise. Ping is a powerful utility to help determine network related problems.
SYNTAX
ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] destination-list
- -t — Pings the specified host until stopped.
To see statistics and continue — type Control-Break;
To stop — type Control-C. - -a — Resolve addresses to hostnames.
- -n — count Number of echo requests to send.
- -l — size Send buffer size.
- -f — Set Don’t Fragment flag in packet.
- -i TTL — Time To Live.
- -v TOS — Type Of Service.
- -r count — Record route for count hops.
- -s count — Timestamp for count hops.
- -j host-list — Loose source route along host-list.
- -k host-list — Strict source route along host-list.
- -w timeout — Timeout in milliseconds to wait for each reply.
EXAMPLES
ping localhost
- — Pings the localhost (127.0.0.1). This determines whether the ethernet card is able to send and receive data. Note that this does not send information over a network, so its main use is troubleshooting network card problems.
- C:\>
- Pinging 127.0.0.1 with 32 bytes of data:
- Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
- Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
- Reply from 127.0.0.1: bytes=32 time=1ms TTL=128
- Reply from 127.0.0.1: bytes=32 time=1ms TTL=128
- Ping statistics for 127.0.0.1:
- Packets: Sent=4, Received = 4, Lost = 0 (0% loss),
- Approximate round trip times in milli-seconds:
- Minimum = 0ms, Maximum = 1ms, Average = 0ms
ping xxx.xxx.xxx.xxx
- — Allows you to ping another computer where the x’s are located are where you would place the IP address of the computer you are attempting to ping. If this is not able to complete this should relay back an unsuccessful message (request timed out) which could be an indication of cable issues, network card issues, hub issue, etc.
ping helpdesk.doit.wisc.edu
- — can be used to see if computer is connected to the internet by sending a packet to a known web site, in this case the DoIT Helpdesk page.
- C:\>
ping helpdesk.doit.wisc.edu
- Pinging helpdesk.doit.wisc.edu[144.92.9.69] with 32 bytes of data:
- Reply from 144.92.9.69: bytes=32 time=2ms TTL=254
- Reply from 144.92.9.69: bytes=32 time=1ms TTL=254
- Reply from 144.92.9.69: bytes=32 time=2ms TTL=254
- Reply from 144.92.9.69: bytes=32 time=1ms TTL=254
- Ping statistics for 144.92.9.69:
- Packets: Sent=4, Received = 4, Lost = 0 (0% loss),
- Approximate round trip times in milli-seconds:
- Minimum = 1ms, Maximum = 2ms, Average = 1ms
Back to Menu of Commands
TRACERT
The tracert command is very similar to ping, and is used to visually see a network packet being sent and received and the amount of hops required for that packet to get to its destination. It shows you exactly how far a packet can go before it fails. This will help you know if the connection problem is close, or more towards the destination.
SYNTAX
tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
- -d — Do not resolve addresses to hostnames.
- -h — maximum_hops Maximum number of hops to search for target.
- -j — host-list Loose source route along host-list.
- -w — timeout Wait timeout milliseconds for each reply.
EXAMPLES
- The following is an example when we used tracert on helpdesk.doit.wisc.edu. As you can see in the below example we had a very short list / time to get to its destination because we are so close to the web server.
- C:\>
tracert helpdesk.doit.wisc.edu
- Tracing route to helpdesk.doit.wisc.edu [144.92.9.69]
- over a maximum of 30 hops:
- 1 <10 ms <10 ms <10 ms 144.92.124.1
- 2 <10 ms <10 ms <10 ms helpdesk.doit.wisc.edu [144.92.9.69]
- Trace complete.
- Here is another tracert to Google.com, a much further destination.
- C:\>
- Tracing route to google.lb.google.com [216.239.37.100]
- over a maximum of 30 hops:
- 1 <10 ms <10 ms <10 ms 144.92.124.1
- 2 <10 ms <10 ms <10 ms r-peer.net.wisc.edu [144.92.128.131]
- 3 <10 ms <10 ms <10 ms UWMadisonISP-atm0-0-252.core.wiscnet.net [216.5 .1.17]
- 4 <10 ms <10 ms 10 ms UWMilwaukeeISP-atm1-0-1.core.wiscnet.net [140.1 9.8.2]
- 5 40 ms 40 ms 40 ms aads.above.net [206.220.243.71]
- 6 40 ms 30 ms 51 ms core1-core2-oc3-2.ord1.above.net [209.249.0.129]
- 7 40 ms 50 ms 50 ms core2-ord1-oc48.ord2.above.net [208.185.0.202]
- 8 50 ms 60 ms 60 ms lga1-ord2-oc48.lga1.above.net [208.185.156.158]
- 9 80 ms 80 ms 81 ms iad1-lga1-oc48-2.iad1.above.net [216.200.127.61]
- 10 90 ms 80 ms 90 ms core2-iad1-oc48.iad4.above.net [208.185.0.134]
- 11 80 ms 90 ms 80 ms main2colo1-core2-oc12.iad4.above.net [208.185.0 70]
- 12 61 ms 70 ms 60 ms 64.124.113.173.available.google.com [64.124.113 173]
- 13 60 ms 70 ms 60 ms 216.239.47.26
- 14 91 ms 100 ms 100 ms www.google.com [216.239.37.100]
- Trace complete.
Back to Menu of Commands
Most information on these commands were taken from www.computerhope.com which has a very extensive list of commands available.
Even with all the fancy-pants new features found in Windows XP and now Vista, Microsoft Windows 98 (Second Edition) remains our favorite Windows-flavored operating system. We love it so much, we still use it on one of our trusty laptops. Over the years, we have discovered several very useful functions available via the command line or even the “Run” prompt (Start
→ Run...
).
Anyway, without spending too much time researching or explaining these wonderful tools, we figured posting the information online may prove beneficial at some point in the future. So, without further ado, we present this working repository of helpful MS run commands:
start
→ starts any program (e.g.,start firefox.exe
)edit
→ open and edit any file (e.g.,edit win.ini
)taskkill.exe
→ close/exit running application(s) or program(s)sort.exe
→ sort file data by the nth character in a lineping
→ send ping (e.g.,ping google.com
)setdebug
→ opens the ActiveX debugging tool for Javarunas.exe
→ launch application as a different userrecover.exe
→ recover data from damaged NTFS diskmsconfig
→ opens the System Configuration Utilitywin.ini
→ displays the win.ini configuration filewininit
→ displays any changes to be implementedopenfiles.exe
→ list or close any group of filessysedit
→ opens the System Configuration Editorwinipcfg
→ opens the IP Configuration Utilitycommand.com
→ opens the MS-DOS command promptdoskey
→ installs various command line toolsexplorer
→ opens the Windows Explorer Windowdefrag
→ opens the Disk Defragmentation toolcdplayer
→ opens the Windows CD Player (wow)scanreg
→ runs the Windows Registry Checkerextract
→ opens the File Extraction Utilityinf
→ opens thewindows\inf
directoryiextract
→ extracts IE backup informationfdisk
→ initiates the Disk Format Utilityscandisk
→ initiates the ScanDisk Utilitydrwatson
→ runs Dr. Watson error debuggerattrib
→ opens the File Attribute Editorwinfile
→ opens the Windows File Managerdrvspace
→ opens the DriveSpace Utilitychkdsk
→ opens the Drive Error Checkerwinhelp
→ opens the Windows Help toolcalc
→ opens the Microsoft Calculatormem
→ opens Memory Information panelregedit
→ opens the Registry Editoripconfig
→ display network settingsprogman
→ opens the Program Managersetver
→ runs the Set Version toollabel
→ opens Drive Label Utilitypbrush
→ opens Microsoft Paintdiskcopy
→ copy a floppy disktelnet
→ opens Windows Telnetnet
→ opens the Net Utility
If something doesn’t look or work as it should, or if you have additional information, please drop a comment — we would love to flesh out this post with information that is both useful and accurate. Thanks!
About the Author
Jeff Starr = Web Developer. Book Author. Secretly Important.
BBQ Pro: The fastest firewall to protect your WordPress.
This article lists commands provided by MS-DOS compatible operating systems, especially as used on IBM PC compatibles. Many unrelated disk operating systems use the DOS acronym and are not part of the scope of this list.
Some commands are implemented as built-in to the command interpreter while others are external applications. Over multiple generations, commands were added for additional functions. In Windows, the legacy shell Command Prompt provides many of these commands.
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—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 file name, or a filename including wildcards (* and ?), are said to accept a filespec (file specification) parameter. Commands that can accept only a single file name 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 filenames, file specifications, and other options.
The command interpreter preserves the case of whatever parameters are passed to commands, but the command names themselves and file names are case-insensitive.
Many commands are the same across many DOS systems, but some differ in command syntax or name.
A partial list of the most common commands for MS-DOS and IBM PC DOS follows below.
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]
The command 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]
Lists connections and addresses seen by Windows ATM call manager.
Attrib changes or views the attributes of one or more files. It 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]
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]
An implementation of the BASIC programming language for PCs. Implementing BASIC in this way was very common in operating systems on 8- and 16-bit machines made in the 1980s.
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.
This command is used to instruct 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]
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]
The CHDIR (or the alternative name CD) command either displays or changes the current working directory.
The command is available in MS-DOS versions 2 and later.[1]
The command 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 verifies a storage volume (for example, a hard disk, disk partition or floppy disk) for file system integrity. The command has the ability to fix errors on a volume and recover information from defective disk sectors of a volume.
The command is available in MS-DOS versions 1 and later.[1]
The CHOICE command is used in batch files to prompt the user to select one item from a set of single-character choices. Choice 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).
The CLS or CLRSCR command clears the terminal screen.
The command is available in MS-DOS versions 2 and later.[1]
Start a new instance of the command interpreter.
The command is available in MS-DOS versions 1 and later.[1]
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]
Makes copies of existing files.
The command is available in MS-DOS versions 1 and later.[1]
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]
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]
This section needs expansion. You can help by adding to it. (May 2019) |
(Not a command: This is a batch file added to DOS 6.X Supplemental Disks to help create DoubleSpace boot floppies.[5])
A disk compression utility supplied with MS-DOS version 6.0 (released in 1993) and version 6.2.[1]
A very primitive assembler and disassembler.
The command has the ability to analyze the file fragmentation on a disk drive or to defragment 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 (or the alternative form ERASE) is used to delete one or more files.
The command is available in MS-DOS versions 1 and later.[1]
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. This command is not present in Windows 7 and 8. In Windows 10, the command switch is RD /S or RMDIR /S.
The DIR command displays the contents of a directory. The contents comprise 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.
A command for comparing 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]
A command for copying the complete contents of a diskette to another diskette.
The command is available in MS-DOS versions 2 and later.[1]
A command that 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]
This section needs expansion. You can help by adding to it. (April 2020) |
Displays how much memory various DOS components occupy.[6]
A disk compression utility supplied with MS-DOS version 6.22.[1]
The ECHO command prints its own arguments back out to the DOS equivalent of the standard output stream. (Hence the name, ECHO) Usually, this means directly to the screen, but the output of echo can be redirected, like any other command, to files or devices. Often used in batch files to print text out to the user.
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 is 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.
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.
This section needs expansion. You can help by adding to it. (July 2019) |
The EMM386 command 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]
See: DEL and ERASE
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]
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]
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]
This section needs expansion. You can help by adding to it. (May 2019) |
FAKEMOUS is 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.
Provides information for MS-DOS commands.
A command that provides accelerated access to frequently-used files and directories.
The command is available in MS-DOS versions 3.3 and later.[1]
Show differences between any two files, or any two sets of files.
The command is available in MS-DOS versions 2 and later – primarily non-IBM releases.[1]
The FDISK command 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]
The FIND command is 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]
The FINDSTR command is a GREP-oriented FIND-like utility. Among its uses is the logical-OR lacking in FIND.
FINDSTR "YES NO MAYBE" *.txt
-
- would find all TXT files with one or more of the above-listed words YES, NO, MAYBE.
Iteration: repeats a command for each out of a specified set of files.
The FOR loop can be used to parse a file or the output of a command.
The command is available in MS-DOS versions 2 and later.[1]
Deletes the FAT entries and the root directory of the drive/partition, and reformats 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 drive.
The command is available in MS-DOS versions 1 and later.[1]
Main article: Goto
The Goto command transfers execution to a specified label. Labels are specified at the beginning of a line, with a colon (:likethis
).
The command is available in MS-DOS versions 2 and later.[1]
Used in Batch files.
This section needs expansion. You can help by adding to it. (July 2019) |
The GRAFTABL command enables the display of an extended character set in graphics mode.[10]
The command is available in MS-DOS versions 3 through 5.[1]
A TSR program to enable the sending of graphical screen dump to printer by pressing <Print Screen>.
The command is available in MS-DOS versions 3.2 and later and IBM PC DOS releases 2 and later.[1]
Gives help about DOS commands.
The command is available in MS-DOS versions 5 thru Windows XP. Full-screen command help is available in MS-DOS versions 6 and later.[1] Beginning with Windows XP, the command processor «DOS» offers builtin-help for commands by using /? (e.g. COPY /?)
IF is a conditional statement, that allows branching of the program execution. It evaluates the specified condition, and only if it is true, then it executes the remainder of the command line. Otherwise, it skips the remainder of the line and continues with next command line.
Used in Batch files.
The command is available in MS-DOS versions 2 and later.[1]
INTERSVR and INTERLNK
[edit]
In MS-DOS; filelink in DR-DOS.
Network PCs using a null modem cable or LapLink cable. 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 terminate-and-stay-resident program) 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.[11][1]
The JOIN command attaches a drive letter to a specified directory on another drive.[11] The opposite can be achieved via the SUBST command.
The command is available in MS-DOS versions 3 through 5. It is available separately for versions 6.2 and later on the Supplemental Disk.[1]
The KEYB command is used to select a keyboard layout.
The command is available in MS-DOS versions 3.3 and later.[1]
From DOS 3.0 through 3.21, there are instead per-country commands, namely KEYBFR, KEYBGR, KEYBIT, KEYBSP and KEYBUK.
Changes the label on a logical drive, such as a hard disk partition or a floppy disk.
The command is available in MS-DOS versions 3.1 and later and IBM PC DOS releases 3 and later.[1]
Used in the CONFIG.SYS file to set the maximum number of drives that can be accessed.
The command is available in MS-DOS versions 3.0 and later.[12]
This section needs expansion. You can help by adding to it. (April 2020) |
Microsoft 8086 Object Linker[13]
Loads a program above the first 64K of memory, and runs the program. The command is available in MS-DOS versions 5 and later.[1] It is 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.[14]
A command that loads a program into the upper memory area.
The command is available in MS-DOS versions 5 and later.[1]
It is called hiload in DR-DOS.
Makes a new directory. The parent of the directory specified will be created if it does not already exist.
The command is available in MS-DOS versions 2 and later.[1]
Displays memory usage. It is capable of displaying program size and status, memory in use, and internal drivers. It is an external command.
The command is available in MS-DOS versions 4 and later and DR DOS releases 5.0 and later.[1]
On earlier DOS versions the memory usage could be shown by running CHKDSK
. In DR DOS the parameter /A
could be used to only show the memory usage.
Starting with version 6,[1] MS-DOS included the external program MemMaker which was used to free system memory (especially Conventional memory) by automatically reconfiguring the AUTOEXEC.BAT and CONFIG.SYS files. This was usually done by moving TSR programs and device drivers to the upper memory. The whole process required two system restarts. Before the first restart the user was asked whether to enable EMS Memory, since use of expanded memory required a reserved 64KiB region in upper memory. The first restart inserted the SIZER.EXE program which gauged the memory needed by each TSR or Driver. MemMaker would then calculate the optimal Driver and TSR placement in upper memory and modify the AUTOEXEC.BAT and CONFIG.SYS accordingly, and reboot the second time.[15]
MEMMAKER.EXE and SIZER.EXE were developed for Microsoft by Helix Software Company and were eliminated starting in MS-DOS 7 (Windows 95); however, they could be obtained from Microsoft’s FTP server as part of the OLDDOS.EXE package, alongside other tools.
PC DOS uses another program called RamBoost to optimize memory, working either with PC DOS’s HIMEM/EMM386 or a third-party memory manager. RamBoost was licensed to IBM by Central Point Software.
This section needs expansion. You can help by adding to it. (May 2019) |
The MIRROR command saves disk storage information that can be used to recover accidentally erased files.
The command is available in MS-DOS version 5. It is available separately for versions 6.2 and later on Supplemental Disk.[1]
Configures system devices. Changes graphics modes, adjusts keyboard settings, prepares code pages, and sets up port redirection.[16]
The command is available in MS-DOS versions 3.2 and later and IBM PC DOS releases 1 and later.[1]
The MORE command paginates text, so that one can view files containing more than one screen of text. More may also be used as a filter. While viewing MORE text, the return key displays the next line, the space bar displays the next page.
The command is available in MS-DOS versions 2 and later.[1]
Moves files or renames directories.
The command is available in MS-DOS versions 6 and later.[1]
DR-DOS used a separate command for renaming directories, rendir
.
Main article: MSAV
A command that scans the computer for known viruses.[17][18]
The command is available in MS-DOS versions 6 and later.[1]
The MSBACKUP command is used to backup or restore one or more files from one disk to another.
The New York Times said that MSBACKUP «is much better and faster than the old BACKUP command used in earlier versions of DOS, but it does lack some of the advanced features found in backup software packages that are sold separately.[19] There is another offering, named MWBACKUP, that is GUI-oriented. It was introduced for Windows for Workgroups (3.11).[20]
The MSBACKUP command is available in MS-DOS versions 6 and later.[1]
MSCDEX is a driver executable which allows DOS programs to recognize, read, and control CD-ROMs.
The command is available in MS-DOS versions 6 and later.[1]
The MSD command provides detailed technical information about the computer’s hardware and software. MSD was new in MS-DOS 6;[1][21] the PC DOS version of this command is QCONFIG.[22] The command appeared first in Word2, and then in Windows 3.10.
This section needs expansion. You can help by adding to it. (May 2019) |
The MSHERC.COM (also QBHERC.COM) was a TSR graphics driver supplied with Microsoft QuickC, QuickBASIC, and the C Compiler, to allow use of the Hercules adapter high-resolution graphics capability (720 x 348, 2 colors).[23]
This section needs expansion. You can help by adding to it. (May 2019) |
Loads extended Nationalization and Localization Support from COUNTRY.SYS, and changed the codepage of drivers and system modules resident in RAM.[citation needed]
In later versions of DR-DOS 6, NLSFUNC relocated itself into the HiMem area, thereby freeing a portion of the nearly invaluable lower 640KiB that constituted the ”conventional” memory available to software.[citation needed]
The command is available in MS-DOS versions 3.3 and later.[1]
Displays or sets a search path for executable files.
The command is available in MS-DOS versions 2 and later.[1]
Suspends processing of a batch program and displays the message Press any key to continue. . ., if not given other text to display.
The command is available in MS-DOS versions 1 and later.[1]
Allows the user to test the availability of a network connection to a specified host. Hostnames are usually resolved to IP addresses.[24]
It is not included in many DOS versions; typically ones with network stacks will have it as a diagnostic tool.
This section needs expansion. You can help by adding to it. (May 2019) |
The POWER command is used to turn power management on and off, report the status of power management, and set levels of power conservation. It is an external command implemented as POWER.EXE.[25]
The command is available in MS-DOS versions 6 and later.[1]
The PRINT command adds or removes files in the print queue. This command was introduced in MS-DOS version 2.[1] 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.
This section needs expansion. You can help by adding to it. (May 2019) |
The PROMPT command allows the user to change the prompt in the command screen. The default prompt is $p (i.e. PROMPT $p), which displays the drive and current path as the prompt, but can be changed to anything. PROMPT $d, displays the current system date as the prompt. Type PROMPT /? in the cmd screen for help on this function.
The command is available in MS-DOS versions 2 and later and IBM PC DOS releases 2.1 and later.[1]
This section needs expansion. You can help by adding to it. (April 2020) |
A utility inspired by the UNIX/XENIX ps command. It also provides a full-screen mode, similar to the top utility on UNIX systems.[6]
An integrated development environment and BASIC interpreter.
The command is available in MS-DOS versions 5 and later.[1]
Remove a directory (delete a directory); by default the directories must be empty of files for the command to succeed.
The command is available in MS-DOS versions 2 and later.[1]
The deltree command in some versions of MS-DOS and all versions of Windows 9x removes non-empty directories.
A primitive filesystem error recovery utility included in MS-DOS / IBM PC DOS.
The command is available in MS-DOS versions 2 through 5.[1]
Remark (comment) command, normally used within a batch file, and for DR-DOS, PC/MS-DOS 6 and above, in CONFIG.SYS. This command is processed by the command processor. Thus, its output can be redirected to create a zero-byte file. REM is 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.
The REN command renames a file. Unlike the move
command, this command cannot be used to rename subdirectories, or rename files across drives. Mass renames can be accomplished by the use of the wildcards characters asterisk (*) and question mark (?).[26]
The command is available in MS-DOS versions 1 and later.[1]
A command that is used to replace one or more existing computer files or add new files to a target directory.
The command is available in MS-DOS versions 3.2 and later.[1]
See: BACKUP and RESTORE
Disk diagnostic utility. Scandisk was a replacement for the chkdsk
utility, starting with MS-DOS version 6.2 and later.[1] 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, 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.
This section needs expansion. You can help by adding to it. (July 2019) |
The SELECT command formats a disk and installs country-specific information and keyboard codes.
It was initially only available with IBM PC DOS. The version included with PC DOS 3.0 and 3.1 is hard-coded to transfer the operating system from A: to B:, while from PC DOS 3.2 onward you can specify the source and destination, and can be used to install DOS to the harddisk.
The version included with MS-DOS 4 and PC DOS 4 is no longer a simple command-line utility, but a full-fledged installer.
The command is available in MS-DOS versions 3.3 and 4 and IBM PC DOS releases 3 through 4.[1]
This command is no longer included in DOS Version 5 and later, where it has been replaced by SETUP.
Sets environment variables.
The command is available in MS-DOS versions 2 and later.[1]
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. From at least Windows 2000, the set
command allows for the evaluation of strings into variables, thus providing inter alia a means of performing integer arithmetic.[27]
This section needs expansion. You can help by adding to it. (July 2019) |
The command is available in MS-DOS versions 5 and later.[1]
This command does a computer setup. With all computers running DOS versions 5 and
later, it runs the computer setup, such as Windows 95 setup and Windows 98 setup.
SetVer is a TSR program 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.
The command is available in MS-DOS versions 5 and later.[1]
Installs support for file sharing and locking capabilities.
The command is available in MS-DOS versions 3 and later.[1]
The SHIFT command increases number of replaceable parameters to more than the standard ten for use in batch files.
This is done by changing the position of replaceable parameters. It replaces each of the replacement parameters with the subsequent one (e.g. %0
with %1
, %1
with %2
, etc.).
The command is available in MS-DOS versions 2 and later.[1]
This section needs expansion. You can help by adding to it. (May 2019) |
The external command SIZER.EXE is not intended to be started directly from the command prompt. Is used by MemMaker during the memory-optimization process.
The command is available in MS-DOS versions 6 and later.[1]
A filter to sort lines in the input data stream and send them to the output data stream. Similar to the Unix command sort
. Handles files up to 64k. This sort is always case insensitive.[28]
The command is available in MS-DOS versions 2 and later.[1]
A utility to map a subdirectory to a drive letter.[11] The opposite can be achieved via the JOIN command.
The command is available in MS-DOS versions 3.1 and later.[1]
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.
The command is available in MS-DOS versions 1 and later.[1]
The Telnet Client is a tool for developers and administrators to help manage and test network connectivity.[29]
Display the system time and waits for the user to enter a new time. Complements the DATE command.
The command is available in MS-DOS versions 1 and later.[1]
Enables a user to change the title of their MS-DOS window.
It is an external command, graphically displays the path of each directory and sub-directories on the specified drive.
The command is available in MS-DOS versions 3.2 and later and IBM PC DOS releases 2 and later.[1]
Internal command that expands the name of a file, directory, or drive, and display its absolute pathname as the result. It will expand relative pathnames, SUBST drives, and JOIN directories, to find the actual directory.
For example, in DOS 7.1, if the current directory is C:\WINDOWS\SYSTEM, then
C:\WINDOWS\SYSTEM>TRUENAME ..\WIN.INI C:\WINDOWS\WIN.INI
The argument does not need to refer to an existing file or directory: TRUENAME will output the absolute pathname as if it did. Also TRUENAME does not search in the PATH.
For example, in DOS 5, if the current directory is C:\TEMP, then TRUENAME command.com
will display C:\TEMP\COMMAND.COM (which does not exist), not C:\DOS\COMMAND.COM (which does and is in the PATH).
This command 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 version 5.00 and later, including the DOS 7 and 8 in Windows 95/98/ME. The C library function realpath
performs this function. The Microsoft Windows NT command processors do not support this command, including the versions of command.com for NT.
Displays a file. The more
command is frequently used in conjunction with this command, e.g. type long-text-file | more
. TYPE can be used to concatenate files (type file1 file2 > file3
); however this won’t work for large files[dubious – discuss][citation needed]—use copy command instead.
The command is available in MS-DOS versions 1 and later.[1]
Restores file previously deleted with del. By default all recoverable files in the working directory are restored; 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.
The command is available in MS-DOS versions 5 and later.[1]
MS-DOS version 5 introduced the quick format option (Format /Q
) which removes the disk’s file table without deleting any of the data. The same version also introduced the UNFORMAT command to undo the effects of a quick format, restoring the file table and making all the files accessible again.
UNFORMAT only works if invoked before any further changes have overwritten the drive’s contents.[1]
An internal DOS command, that reports the DOS version presently running, and since MS-DOS 5, whether DOS is loaded high.
The command is available in MS-DOS versions 2 and later.[1]
Enables or disables the feature to determine if files have been correctly written to disk (You can enable the verify command by typing «verify on» on Command Prompt and pressing enter. To display the current VERIFY setting, type VERIFY without a parameter. To turn off the feature, type «verify off»). If no parameter is provided, the command will display the current setting.[30]
The command is available in MS-DOS versions 2 and later.[1]
An internal command that displays the disk volume label and serial number.
The command is available in MS-DOS versions 2 and later.[1]
Main article: MSAV
A TSR program that continuously monitors the computer for viruses.
The command is available in MS-DOS versions 6 and later.[1]
Copy entire directory trees. Xcopy is a version of the copy command that can move files and directories from one location to another.
XCOPY usage and attributes can be obtained by typing XCOPY /? in the DOS Command line.
The command is available in MS-DOS versions 3.2 and later.[1]
- Category:Windows commands
- COMMAND.COM
- cmd.exe – command-line interpreter in various Windows and OS/2 systems
- Command-line interface
- List of CONFIG.SYS directives
- Timeline of DOS operating systems
- ^ a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN 0-7356-1812-7.
- ^ «MS-DOS choice command help». Retrieved 2014-09-10.
- ^ a b «Caldera DR-DOS 7.03 User Guide». Archived from the original on 2015-09-23. Retrieved 2014-09-10.
- ^ Does not automatically appear in Help
- ^ «Q100021: Unable to Access Compressed Drives Using DBLBOOT.BAT Disk».
- ^ a b Multitasking MS-DOS 4.0, Goupil OEM
- ^ «expand — Windows CMD». SS64.com. Retrieved 2022-08-27.
- ^ «Q97835: COMMANDS.TXT: Supplemental Disk Commands (Part 2 of 2)».
- ^ «Q117600: MS-DOS 6.22 Supplemental Disk: Description & How to Obtain».
- ^ graftabl | Microsoft Docs
- ^ a b c EasyDOS Command Index
- ^ «DOS Command: LASTDRIVE». easydos.com. Retrieved 2025-04-05.
- ^ MS-DOS Version 4.10 Fujitsu ICL OEM
- ^ DR DOS 6.0 User Guide. Digital Research. 1991.
- ^ Cooper, Jim (May 2001). Using MS-DOS 6.22. Que Publishing. p. 455. ISBN 0789725738.
- ^ «MS-DOS mode command help». Retrieved 2014-09-10.
- ^ «More».
- ^ MS-DOS and Windows command line msav command
- ^ Peter H. Lewis (1994-01-04). «It’s 1994. So Where Are Your Data?». The New York Times.
- ^ Source: Zeos International: «What is MWBACKUP.EXE?». 2019-02-25.
- ^ «MS-DOS msd command help». Retrieved 2014-09-10.
- ^ Brooks, Vernon. «List of DOS commands». PC DOS Retro. Archived from the original on 2024-01-09. Retrieved 2024-01-09.
- ^ https://www.pcjs.org/pubs/pc/reference/microsoft/kb/Q44273/ [dead link]
- ^ «MS-DOS and Windows command line ping command».
- ^ MS-DOS and Windows command line power command
- ^ «Microsoft TechNet Rename (ren) article». 2009-09-11.
- ^ Karp, David Aaron; Tim O’Reilly; Troy Mott (2005). Windows XP in a nutshell. Nutshell handbook (2 ed.). O’Reilly Media, Inc. p. 422. ISBN 978-0-596-00900-7. Retrieved 2010-11-26.
- ^ «Microsoft on «sort»«. 2014-02-20. Retrieved 2014-09-10.
- ^ Client must be activated from Admin
- ^ «DOS Command: VERIFY». Retrieved 2014-09-10.
- Cooper, Jim (2001). Special Edition Using MS-DOS 6.22, Third Edition. Que Publishing. ISBN 978-0789725738.
- Wolverton, Van (1990). MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition. Microsoft Press. ISBN 978-1556152894.
- Command-Line Reference : Microsoft TechNet Database «Command-Line Reference»
- The MS-DOS 6 Technical Reference on TechNet contains the official Microsoft MS-DOS 6 command reference documentation.
- DR-DOS 7.03 online manual[usurped]
- MDGx MS-DOS Undocumented + Hidden Secrets
- MS-DOS v1.25 and v2.0 source code
There are several guides to DOS commands available that are licensed under the GNU Free Documentation License:
- The FreeDOS Spec at SourceForge is a plaintext specification, written in 1999, for how DOS commands should work in FreeDOS
- MS-DOS commands
- Reference for windows commands with examples
- A Collection of Undocumented and Obscure Features in Various MS-DOS Versions