You are on page 1of 15

MS-DOS commands

Below is a listing of each of the MS-DOS commands currently listed on


Computer Hope and a brief explanation of what each of the commands do.
The below commands are all MS-DOS commands, which means not all the
below commands will work in your version of MS-DOS and/or Windows
command line. Clicking on the command will open the help page for that
command with full details about it.

Command Description Type


Defines functions that change display graphics, control cursor movement, and
ansi.sys File
reassign keys.
Causes MS-DOS to look in other directories when editing a file or running a
append External
command.
arp Displays, adds, and removes arp information from network devices. External
assign Assign a drive letter to an alternate letter. External
assoc View the file associations. Internal
at Schedule a time to execute commands or programs. External
atmadm Lists connections and addresses seen by Windows ATM call manager. Internal
attrib Display and change file attributes. External
batch Recovery console command that executes a series of commands in a file. Recovery
Recovery console command that allows a user to view, modify, and rebuild the
bootcfg Recovery
boot.ini
break Enable / disable CTRL + C feature. Internal
cacls View and modify file ACL's. External
call Calls a batch file from another batch file. Internal
cd Changes directories. Internal
chcp Supplement the International keyboard and character set information. External
chdir Changes directories. Internal
chdsk Check the hard disk drive running FAT for errors. External
chkntfs Check the hard disk drive running NTFS for errors. External
choice Specify a listing of multiple options within a batch file. External

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 1


cls Clears the screen. Internal
cmd Opens the command interpreter.
color Easily change the foreground and background color of the MS-DOS window. Internal
command Opens the command interpreter.
comp Compares files. External
compact Compresses and uncompress files. External
control Open Control Panel icons from the MS-DOS prompt. External
convert Convert FAT to NTFS. External
copy Copy one or more files to an alternate location. Internal
ctty Change the computers input/output devices. Internal
date View or change the systems date. Internal
debug Debug utility to create assembly programs to modify hardware settings. External
defrag Re-arrange the hard disk drive to help with loading programs. External
del Deletes one or more files. Internal
delete Recovery console command that deletes a file. Internal
deltree Deletes one or more files and/or directories. External
dir List the contents of one or more directory. Internal
disable Recovery console command that disables Windows system services or drivers. Recovery
diskcomp Compare a disk with another disk. External
diskcopy Copy the contents of one disk and place them on another disk. External
doskey Command to view and execute commands that have been run in the past. External
dosshell A GUI to help with early MS-DOS users. External
drivparm Enables overwrite of original device drivers. Internal
echo Displays messages and enables and disables echo. Internal
edit View and edit files. External
edlin View and edit files. External
emm386 Load extended Memory Manager. External
ename Recovery console command to enable a disable service or driver. Recovery

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 2


Stops the localization of the environment changes enabled by the setlocal
endlocal Internal
command.
erase Erase files from computer. Internal
exit Exit from the command interpreter. Internal
expand Expand a Microsoft Windows file back to it's original format. External
extract Extract files from the Microsoft Windows cabinets. External
fasthelp Displays a listing of MS-DOS commands and information about them. External
fc Compare files. External
fdisk Utility used to create partitions on the hard disk drive. External
find Search for text within a file. External
findstr Searches for a string of text within a file. External
fixboot Writes a new boot sector. Recovery
fixmbr Writes a new boot record to a disk drive. Recovery
for Boolean used in batch files. Internal
format Command to erase and prepare a disk drive. External
ftp Command to connect and operate on a FTP server. External
ftype Displays or modifies file types used in file extension associations. Recovery
goto Moves a batch file to a specific label or location. Internal
graftabl Show extended characters in graphics mode. External
help Display a listing of commands and brief explanation. External
if Allows for batch files to perform conditional processing. Internal
ifshlp.sys 32-bit file manager. External
ipconfig Network command to view network adapter settings and assigned values. External
keyb Change layout of keyboard. External
label Change the label of a disk drive. External
lh Load a device driver in to high memory. Internal
listsvc Recovery console command that displays the services and drivers. Recovery
loadfix Load a program above the first 64k. External

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 3


loadhigh Load a device driver in to high memory. Internal
lock Lock the hard disk drive. Internal
logoff Logoff the currently profile using the computer. External
logon Recovery console command to list installations and enable administrator login. Recovery
map Displays the device name of a drive. Recovery
md Command to create a new directory. Internal
mem Display memory on system. External
mkdir Command to create a new directory. Internal
mode Modify the port or display settings. External
more Display one page at a time. External
move Move one or more files from one directory to another directory. Internal
msav Early Microsoft Virus scanner. External
msd Diagnostics utility. External
msdex Utility used to load and provide access to the CD-ROM. External
nbtstat Displays protocol statistics and current TCP/IP connections using NBT External
net Update, fix, or view the network or network settings External
netsh Configure dynamic and static network information from MS-DOS. External
netstat Display the TCP/IP network protocol statistics and information. External
nlsfunc Load country specific information. External
nslookup Look up an IP address of a domain or host on a network. External
path View and modify the computers path location. Internal
pathping View and locate locations of network latency. External
pause Command used in batch files to stop the processing of a command. Internal
ping Test / send information to another network computer or network device. External
popd Changes to the directory or network path stored by the pushd command. Internal
power Conserve power with computer portables. External
print Prints data to a printer port. External
prompt View and change the MS-DOS prompt. Internal

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 4


Stores a directory or network path in memory so it can be returned to at any
pushd Internal
time.
qbasic Open the QBasic. External
rd Removes an empty directory. Internal
ren Renames a file or directory. Internal
rename Renames a file or directory. Internal
rmdir Removes an empty directory. Internal
route View and configure windows network route tables. External
runas Enables a user to run a program as a different user. External
scandisk Run the scandisk utility. External
scanreg Scan registry and recover registry from errors. External
set Change one variable or string to another. Internal
setlocal Enables local environments to be changed without affecting anything else. Internal
setver Change MS-DOS version to trick older MS-DOS programs. External
share Installs support for file sharing and locking capabilities. External
shift Changes the position of replaceable parameters in a batch program. Internal
shutdown Shutdown the computer from the MS-DOS prompt. External
smartdrv Create a disk cache in conventional memory or extended memory. External
sort Sorts the input and displays the output to the screen. External
start Start a separate window in Windows from the MS-DOS prompt. Internal
subst Substitute a folder on your computer for another drive letter. External
switches Remove add functions from MS-DOS. Internal
sys Transfer system files to disk drive. External
telnet Telnet to another computer / device from the prompt. External
time View or modify the system time. Internal
title Change the title of their MS-DOS window. Internal
tracert Visually view a network packets route across a network. External
tree View a visual tree of the hard disk drive. External

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 5


type Display the contents of a file. Internal
undelete Undelete a file that has been deleted. External
unformat Unformat a hard disk drive. External
unlock Unlock a disk drive. Internal
ver Display the version information. Internal
verify Enables or disables the feature to determine if files have been written properly. Internal
vol Displays the volume information about the designated drive. Internal
xcopy Copy multiple files, directories, and/or drives from one location to another. External

Command Name Description


Allows programs to open data files in specified directories as if they were in
APPEND the
current directory.
ATTRIB Displays or changes file attributes.
Sets the Ctrl+Break check on or off. Can be used at the command prompt or
BREAK in the
config.sys

BUFFERS Allocates memory for a specified number of disk buffers from within the
config.sys
CALL Calls one batch file from another without exiting from the first.
CD or CHDIR Changes the current directory.
CHCP Displays or changes the active code page.
CHKDSK Checks a disk and displays a status report.
CHOICE Waits for the user to choose one of a set of choices.
CLS Clears the screen.
COMMAND Starts a new copy of the MS-DOS Command Interpreter.
COPY Copies the specified files.
COUNTRY Enables MS-DOS to use country-specific conventions.
CTTY Changes the standard Input/ Output device.
DATE Displays or sets the system date.
DBLSPACE Creates or configures DoubleSpace compressed drives.
DEBUG Runs Debug, a program testing and editing tool.
DEFRAG Reorganizes files on disks to optimize performance.

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 6


DEL Deletes the specified files.
DELTREE Deletes a directory and all the subdirectories and files in it.
DEVICE Loads a specified device driver into memory from within your config.sys
DEVICEHIGH Loads a specified device driver into the upper memory area from within your
config.sys
DIR Displays the disk directory.
DISKCOMP Compares the contents of two floppy disks.
DISKCOPY Copies the contents of one floppy disk to another.
Specifies from within your config.sys that DOS should maintain a link to
the
DOS
upper memory area, load part of itself into High Memory Area (HMA) or
both.
DOSKEY Edits command lines, recalls MS-DOS commands, and creates macros.
DOSSHELL Starts MS-DOS Shell.
MS-DOS Task Swapper. This program is used internally by the MS-DOS
DOSSWAP Shell
and should not be run from the command line.
Defines parameters for devices such as disk and tape drives when you start
DRIVPARM MS-DOS.
This command can only be used in the config.sys file.
ECHO Sets Echo to on or off.
EDIT Starts the MS-DOS Editor, which creates and changes ASCII files.
EMM386 Turns on or off EMM386 expanded memory support.
ERASE Deletes the specified files.
EXIT Exits to the previous command level.
EXPAND Expands one or more compressed files.
FASTHELP Provides help information for MS-DOS commands.
Decreases the amount of time needed to open frequently used files and
FASTOPEN
directories.
FC Compares two files or sets of files and displays the differences between them.
Specifies from within your config.sys file the number of File Control
FCBS Blocks
(FCBs) that DOS can have open at the same time.
FDISK Configures a hard disk for use with MS-DOS.
Specifies from within your config.sys the number of files that DOS can
FILES have
open at one time.
FIND Searches for a text string in a file or files.
FOR Repeats a command for each item in a set.

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 7


FORMAT Formats a disk for use with MS-DOS.
GOTO Jumps to a labelled line from within the same batch file.
GRAPHICS Loads a program that can print graphics.
HELP Starts MS-DOS Help on MS-DOS commands.
IF Allows conditional execution of commands from within a batch file.
Includes from within your config.sys file the contents of one configuration
INCLUDE
block within another.
Loads a memory resident program into memory from within
your config.sys
INSTALL
file.

Connects two computers via parallel or serial ports and enables the computers
INTERLNK to
share disks and printer ports.
Provides serial or parallel file transfer and printing capabilities via redirected
INTERSVR
drives.
KEYB Configures a keyboard for a specific language.
LABEL Creates, changes, or deletes the volume label of a disk.
Specifies in your config.sys file the maximum number of drives you can
LASTDRIVE
access.
LH - LOADHIGH Loads a program into upper memory.
LOADFIX Loads a program above the first 64K of memory, and runs the program.
MEM Displays the amount of used and free memory in your system.
MEMMAKER Runs the MemMaker memory-optimization program.
MENUDEFAULT Specifies the default menu item on the startup menu in the config.sys file.
MENUITEM Defines an item on the startup menu in the config.sys file.
MD - MKDIR Makes (creates) a new directory.
MODE Configures system devices.
MORE Displays output one screen at a time.
MOVE Moves files and renames files and directories.
MSAV Scans your computer for known viruses.
MSBACKUP Backs up or restores one or more files.
MSCDEX Provides access to CD-ROM drives.
Starts the Microsoft Diagnostics program which provides detailed technical
MSD
information about your computer.
NLSFUNC Loads country-specific information.
Specifies from within your config.sys file whether the numlock key is set
NUMLOCK to
on or off.

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 8


PATH Searches alternative directories.
PAUSE Pauses execution of the the batch file.
POWER Reduces power used by your computer.
PRINT Prints a text file while you are using other MS-DOS commands.
PROMPT Changes the system prompt.
QBASIC Starts the MS-DOS QBasic programming environment.
RD - RMDIR Removes (deletes) a directory.
REM Allows remarks to be added to a batch file.
REN - RENAME Renames files.
REPLACE Replaces files.
RESTORE Restores files that were backed up by using the BACKUP command.
SET Changes the system parameters.
SETVER Sets the version number that MS-DOS reports to a program.
SHARE Installs file-sharing and locking capabilities on your hard disk.
Specifies from within the config.sys file the location of the command
SHELL
interpreter you want DOS to use.
SHIFT Allows more than 10 replaceable parameters in a batch file.
SIZER.EXE is used by MemMaker during the memory-optimization process
SIZER and
is not intended to be started from the command prompt.
SMARTDRV Installs and configures the SMARTDrive disk-caching utility.
SORT Sorts input and writes results to the screen, a file, or another device.
Supports the dynamic use of data stacks to handle hardware interupts, from
STACKS within
your config.sys file.
Defines from within the config.sys an item on a start-up menu that, when
SUBMENU
selected displays another set of options.
SUBST Associates a path with a drive letter.
SWITCHES Specifies from within the config.sys special DOS options.
SYS Copies MS-DOS system files and command interpreter to a disk you specify.
TIME Displays or sets the system time.
TREE Displays the directory structure in graphical form.
TYPE Displays a specified text file.
UNDELETE Restores files previously deleted with the DEL command.
Restores a disk erased by the FORMAT command or restructured by the
UNFORMAT
RECOVER command.
VER Displays the version of MS-DOS.
VERIFY Checks that files are correctly written to disk.

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 9


VOL Displays the disk volume label.
VSAFE Monitors your computer for viruses and displays a warning when it finds one
XCOPY Copies files (except hidden and system files) and directory trees.
Changes the current drive.
A: B: C:

Step 1. Overview:

Run cmd.exe or command.exe

To open a Microsoft MS-DOS command prompt shell window, first click the
Windows Start menu (located at the very lower-left corner of your
computer's desktop) and select "Run...".

Then if you are using Windows XP or Vista or Windows 7, type cmd into the
Run box and click "OK". You could also type cmd.exe

Otherwise, if you are using an older version of Windows, type command into
the Run box and click "OK". You could also type command.exe

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 10


Step 2. The Window:

After you click "OK", an MS-DOS command prompt window will appear.
Depending upon which version of Windows you are using, the MS-DOS
command window will look similar to these images:

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 11


Step 3. Text/Background Colors:

The standard window displays white text on a black background. This color
combination may make text difficult to read. To make the window display
black text on a white background, type the command: color f0 (that's the
letter f followed by the digit zero 0). To go back to the standard of white
text on a black background, type:color

Step 4. MS-DOS Commands:

See the MS-DOS Commands index for a description of the commands that
you can type into the MS-DOS command prompt window. The most common
tasks are:

 Change directory (cd)


 How to list directory files (dir)
 Search file contents (find) / Search filenames (dir)
 Make a directory (md)
 Copy a file (copy) / Copy a directory (xcopy)
 Run Notepad text editor (notepad)
 Delete a file (del)
 Hide/unhide a file or directory (attrib)
 Show IP address (ipconfig)

 See also: MS-DOS Frequently Asked Questions


 See also: MS-DOS Commands

To close the window, either type exit and press Enter, or click the X button
in thetop-right of the window frame.

MS-DOS Commands :: cd (change directory)


Overview:

When you are using a Microsoft MS-DOS command window, MS-DOS works
on one directory at a time. The "current" directory is indicated as part of the
command prompt.

For example, the command prompt "C:\mystuff\ebooks>" means that the


current directory is the "ebooks" directory which is located inside the
"mystuff" directory on thec: drive.

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 12


Use the cd command to make a different directory the "current" directory
("cd" is short for "change directory").

The command can be typed as either:

cd directory

or

cd drive:directory

For example, "cd \mystuff" will make "\mystuff" the current directory. To
get to the "root" (top level directory) of your c: drive, type cd \

If directory contains spaces, then enclose it with quotation marks. For


example:cd "C:\Documents and Settings\CCC\My Documents\My
Music" or cd "My Music"

Command Variations:

cd directory
cd drive:directory

Make the specified directory directory (or drive:directory) the current


directory.

The directory can start with a \ or be relative to the current directory. For
example, if the current directory is C:\mystuff then typing cd ebookswill
change the current directory to C:\mystuff\ebooks (assuming that there is
in fact a ebooks sub-directory inside C:\mystuff).

Note: Each drive (c:, d:, e:, etc.) has its own current directory. That's why
there is the drive:directory variation of the cd command. For example: cd
e:\photos will set the current directory of the e: drive to\photos. To switch
to the e: drive, you would simply type e: and press theEnter key.

cd /d drive:directory

Make the specified directory directory the current directory and also switch
do the drive: drive.

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 13


Tip: To make cd always do /d without you having to type it, create
acommand macro named cd by typing: doskey cd = cd /d $*

cd ..

You can also type cd .. (the two dots are required) to back out one level
out of the current directory. For example, if the current directory
isC:\mystuff\ebooks then typing cd .. will change the current directory
toC:\mystuff

cd

If you type cd without specifying a directory, the cd command will display


the directory path of the current directory. Typically you will not use this
variation of the cd command since the directory path is shown in the
command prompt. It is more useful in batch files.

help cd
Displays the name of or changes the current directory.

CHDIR [/D] [drive:][path]


CHDIR [..]
CD [/D] [drive:][path]
CD [..]

.. Specifies that you want to change to the parent directory.

Type CD drive: to display the current directory in the specified drive.


Type CD without parameters to display the current drive and directory.

Use the /D switch to change current drive in addition to changing current


directory for a drive.

If Command Extensions are enabled CHDIR changes as follows:

The current directory string is converted to use the same case as


the on disk names. So CD C:\TEMP would actually set the current
directory to C:\Temp if that is the case on disk.

CHDIR command does not treat spaces as delimiters, so it is possible to


CD into a subdirectory name that contains a space without surrounding
the name with quotes. For example:

cd \winnt\profiles\username\programs\start menu

is the same as: cd "\winnt\profiles\username\programs\start menu"

which is what you would have to type if extensions were disabled.

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 14


(Enlarge: help cd)

Related Commands:
dir

To see what directories are available for you to cd into, use


the dir command.

md
To make a new directory, use the md (or mkdir) command.

Magendira mani Vinayagam/ Academia.edu/Assistant Professor, IC., VNB. Page 15

You might also like