You are on page 1of 93

CMD commands for the Windows

command prompt
Most IT experts and Linux users, in addition to computer users who work with MS-DOS, are relatively
familiar with the command line and its corresponding commands. But a lot can be achieved with
the command prompt in Windows, toOK

We use cookies on our website to provide you with the best possible user experience. By continuing to
use our website or services, you agree to their use. More Information.
Digital Guide

 Websites
o
o
o
o
 Hosting
o
o
o
 Server
o Know-How
o Configuration
o Security
o Tools
 Domains
o
o
o
o
 Online Marketing
o
o
o
o
 E-Mail
o
o
o


  IONOS Products

o
o

o
o

1. IONOS
2. Digitalguide
3. Server
4. Know-how
5. Windows CMD commands

  01.10.20
 Know-how


o
o
o
o

CMD commands for the Windows


command prompt
Most IT experts and Linux users, in addition to computer users who work with MS-DOS, are
relatively familiar with the command line and its corresponding commands. But a lot can be
achieved with the command prompt in Windows, too. For this reason, we’ll explain what the
command line is, how to open it, and which CMD commands there are for Windows.

Windows console commands have changed over time: in newer Windows versions, users no
longer have access to some of the familiar commands. In the following, we’ll explain which CMD
commands still work under Windows 10 so that you don’t have to tediously test which are still
valid and which are outdated. Our overview tables describe the functions of the individual
commands and specify under which Microsoft operating systems they’re effective.

Contents
1. How does a command line work?
2. How do you open the command prompt?
3. How do you enter commands in the command prompt?
4. Windows CMD commands: an overview

How does a command line work?


The command line (also called the console or terminal) is a text-based interface within the
operating system, that forwards commands from the user to the operating system. This makes
it possible, for example, to organize files, start programs, or run other commands linked to the
operating system, computer, or network.

In older operating systems (like MS-DOS), you had to work without a graphical user interface,
and oftentimes even navigate without a mouse. Instead, you had to type in all commands – the
directory structures were then displayed as plain text on the screen. But even after the switch to
graphical operating systems, the command line remained text-based.

In general, the connection between operating system – regardless of whether graphical (GUI =
graphical user interface) or text-based (CLI = command line interpreter) was condensed under
the term “Shell.” The default command line interpreter for Windows is called CMD.EXE. In
addition, however, there’s also the “PowerShell”: This offers more options than CMD.EXE. For
example, automations can be created better with PowerShell. In this way, users can create script
programs with the PowerShell scripting language.

 Note
Many Windows console commands are based on batch files. This are usually text files (with the
ending .bat or .cmd) that are run by the command line as batch processing. These files are
generally created to perform routine work and start other programs.

$1 Domain Names
Register great TLDs for less than $1 for the first year.

Why wait? Grab your favorite domain name today!


Matching email

SSL certificate

24/7/365 support

Save Now

How do you open the command prompt?


There are various options for accessing the command line in Windows. Technically speaking, the
command line is the CMD.EXE program. This executable file should be found in the system
directory of your Windows folder. (If you right-click on the file, Windows also gives you the option
to start the program as an administrator – in case you have the access data for this.) To reach
the program more quickly, you can use the search bar or the run menu. The latter is opened
under Windows 7, 8, and 10 with the key combination Win + R. Then all you have to do is type
“cmd” into the search field and press the OK button.

The command prompt has long had a fixed spot in the Windows start menu as well. Under
Windows 7 and Windows 10, the program is found in the “System Tools” folder. With Windows 8,
Microsoft replaced the start menu with a start screen. But the command prompt is also found via
the apps here. Alternatively, Windows 8 as well as Windows 10 both offer the “Power User Tasks
Menu.” You can open this with the key combination Win + X. In this way, you can find the
command prompt in the normal execution as well as the administrator version.

How do you enter commands in the command prompt?


CMD functions via defined commands. These have to be entered correctly, otherwise the
command prompt can’t run the task. The same goes for parameters that you link to the
commands. Individual commands can be extended using options (such as arguments). These
are generally given as a letter with a minus sign (-), plus sign (+), or slash (/). CMD also allows
placeholders. For so-called wild cards, use an asterisk (*) or question mark (?). While the latter
replaces a single character (i.e. letter, digit, or other character), the asterisk stands for any
number of characters.

 Note
In the command prompt and commands, you also frequently have to work with path
specifications. You need these to navigate through your directories or specify exact positions in
commands. For the input of a path, use the backslash (\).
Individual CMD commands can be combined with one another. Through a pipe, the output of the
first command is interpreted as input for the following command. In the command prompt,
commands are linked to one another with a vertical line (|). This line itself is called a pipe, but
officially is known as a vertical bar. Vertical bars pass data from one command to the next:

 CommandA | CommandB

There’s also the possibility of redirection: where the output of a command is directly forwarded
to a file (>) or the content of a text file is understood as input for the command (<).

 Command > File (output in file)


 Command < File (input from file)

Finally, Windows command line commands can also be connected in such a way that they run
directly after one other. This can be controlled via a relatively simple form (&), but also via two
more complex variations. It’s also possible to only run the second command if the first was
successful. Or, you can set up the exact opposite as well: The second command is only run if the
first doesn’t work (||). Both options can even be combined so that there’s an either-or string of
commands:

 CommandA & CommandB (the second command is run directly after the first)
 CommandA && CommandB (the second command is only run if the first was successful)
 Command A || CommandB (the second command is only run if the first was not
successful)
 CommandA && CommandB || CommandC (the second command is only run if the first
was successful, otherwise the third command is run)

 Tip
Each command has its own syntax and individual options. So that you don’t have to memorize all
of these, CMD offers a help command: Using help command or command /? you can obtain
information about how to handle the command.
It’s also extremely helpful that the command prompt remembers your last entered CMD
commands. Using the up and down arrow keys on the keyboard, you can recall your earlier
entries. This also means, though, that you can’t use these keys to scroll through the CMD
window. This is usually done with the mouse instead. But if you prefer to scroll using keys and
are ready to give up the recall command function, you can alter the corresponding setting: right-
click on the command prompt and enable the “Scrolling” option.

Command, file names or path specifications, as well as arguments, are separated from one
another using spaces. It also usually doesn’t matter if you use upper- or lower-case letters. It’s
only important in a few cases whether you write the parameter in upper- or lower-case (generally
only when two different parameters are abbreviated with the same letter, and are only
differentiated from one another through the case).

3 ways to be present and grow online


Get found with your own domain. Build trust with your own email address. Reach visitors with
your own website.

Buy a domain

Get custom email

Create a website

Windows CMD commands: an overview


There are almost 300 commands for Windows and its predecessor, MS-DOS. Over the decades,
some commands have been kept around, some have only recently been added with newer
versions of Windows, and others have been removed or replaced. In our comprehensive list, we
explain what the different commands mean and on which Windows versions they run. This way,
you can quickly look up whether the CMD commands that you know still function with Windows
10. To make it more clear, we’ve divided the Windows command prompt commands into four
categories: basics, files, system, and network.

 Note
The information on the functionality of various Windows versions should only be understood as
orientation information. For the individual commands, it’s not only which Windows version you’re
using that’s important, but also which edition (Home, Pro, Server). In some cases, you have to
adjust certain settings beforehand so that the commands are effective. You also will need access
rights as an administrator for some CMD commands.
Basics

CMD
command Description Windows version  

bitsadmin Creates and monitors downloads and uploads. 10/8/7/Vista  

break Interrupts Ctrl + C checking in DOS, allowing you to stop All Win/DOS  
CMD
command Description Windows version  

processes in the old operating system. Only available for


compatibility reasons in Windows.

call Calls a batch file within another batch file. The command All Win/DOS  
has no effect if entered directly into CMD instead of in a
batch file.

cd Displays the current directory and lets you switch to other All Win/DOS  
directories. With the parameter /D plus drive and path
specification, you can also switch drives. Use cd.. to
switch to a higher directory (has the same function as the
chdir command).

chcp Changes the current code page (character set table) or All Win/DOS  
shows the page count of the current code page.

chdir Displays the current directory and lets you switch to other All Win/DOS  
directories. With the parameter /D plus drive and path
specification, you can also switch drives. Use chdir.. to
switch to a higher directory (has the same function as the
cd command).

choice Creates a selection list: typical example is the selection of All Win (not XP)/DOS  
yes (Y) or no (N), which is created with /C YN. With the
parameter /M you can add an explanatory message for
the user.

clip Forwards the result of a command to the clipboard. For clip) or the content of 10/8/7/Vist
example, you can copy the directory structure (dir a file (clip < filename)
to the clipboard.

cls Clears the content of the screen. All Win/DOS  

cmd Starts CMD.EXE. 10/8/7/Vista/XP  

color Changes the background (first value) and text color 10/8/7/Vista/XP  
(second value) of the command prompt. The color lies
between 0 (black) and F (white).

command Starts CMD.COM. 32-bit/DOS  

date Displays the current date and allows you to change it. All Win/DOS  
CMD
command Description Windows version  

With the parameter /T the date is shown without the option


to change.

debug Starts debug, a program that can test and modify 32-bit/DOS  
programs within the command prompt.

dir Displays all folders and files within the current directory. All Win/DOS  
You can restrict the output by attributes (/A), simplify the
list (/B), or display all subdirectories and their files (/S).

doskey Creates macros, recalls commands, and edits command All Win/DOS  
input.

dosshell Opens the DOS shell, a graphical file management tool. In 95/DOS  
Windows, the DOS shell is replaced by Windows Explorer.

echo Displays a message and is mainly used within scripts and All Win/DOS  
batch files.

edit Starts the MS-DOS editor, with which you can create text 32-bit/DOS  
files.

edlin Creates and edits text files within the command prompt. 32-bit/DOS  

exit Ends CMD.EXE or CMD.COM. All Win/DOS  

fasthelp Displays helpful information about commands. DOS  

fastopen Writes the position of a program into a specified list, which 32-bit/DOS  
is in the working memory and should accelerate the start
of programs.

find Searches through a file or multiple files for a particular All Win/DOS  
character sequence. If you only want to know how
frequently the word or phrase occurs, use the /C
parameter. With the extension /I the command ignores
upper- and lower-case in the search.

findstr Finds character sequences in one or multiple files. It gives 10/8/7/Vista/XP  


you more options when compared to the find command:
you can search for files that contain various terms or
with /C search for an exact word order.
CMD
command Description Windows version  

forcedos Starts a program in the MS-DOS partial system, in case XP (32-bit)  


it’s not directly recognized by Windows XP as a DOS
program.

graftabl Enables the option to use extended characters of a 32-bit/DOS  


specific code page in graphics mode.

graphics Starts a program that can print graphics. 32-bit/DOS  

help Displays help text for a specific command (you can also All Win/DOS  
use the /? command).

kb16 Changes the country settings of the keyboard for DOS 32-bit  
programs (only included in Windows for compatibility
reasons. Replaces the old command keyb).

keyb Changes the country settings of the keyboard for DOS 98/95/DOS  
programs (only included in Windows for compatibility
reasons. Replaced by kb16 in newer Windows versions).

logoff Logs the user out of Windows. Also allows you to end 10/8/7/Vista/XP  
sessions on servers.

lpq Displays the status of a printer queue for computers that All Win  
use a “line Printer Daemon” (LPD). (To use the command
in Windows 10, 8, 7, or Vista, the LPD print service and
the LPR port monitor have to be enabled first).

lpr Sends a file to a computer that uses a line printer daemon All Win  
(LPD). To use the command in Windows 10, 8, 7, or Vista,
the LPD print service and LPR port monitor have to be
enabled first.

md Creates a new directory on the specified path. If All Win/DOS  


directories don’t already exist on the path, md creates
them automatically (you can also use the mkdir
command).

mkdir Creates a new directory on the specified path. If All Win/DOS  


directories don’t already exist on the path, mkdir creates
them automatically (you can also use the md command).

more Outputs the content of a file (for example, a text file) by All Win/DOS  
CMD
command Description Windows version  

the page. You can also use the command to split the
output of another command into pages.

msg Sends a message to another user. You can write the 10/8/7/Vista/XP  
username into the command or create files in which
usernames are saved. The files can then be included in
the command with @filename.

nlsfunc Provides country-specific information for language 32-bit/DOS  


support.

ntbackup Runs backup services directly from the command line or XP  


as part of batch or script files.

path Creates and displays the path for searching executable All Win/DOS  
files.

pause Pauses execution in batch files and scripts. The user is All Win/DOS  
then prompted in a message to continue by pressing a
key.

popd Changes to the folder saved by the pushd command. The 10/8/7/Vista  
command is mainly part of batch files and scripts.

print Prints a text file. The device to be used for printing has to All Win/DOS  
be specified.

prompt Changes the display of the command prompt. All Win/DOS  

pushd Saves a specific path into a script or batch file. You can 10/8/7/Vista/XP  
change to this directory with popd.

qbasic Starts qbasic, a program environment based on the 98/95/DOS  


BASIC programming language.

rd Deletes a directory. This must not contain any files, even All Win/DOS  
hidden ones. You can delete an entire directory tree with
the /S parameter (you can also use the rmdir command).

rem Writes comments in batch and script files that aren’t taken All Win/DOS  
into account when executing.
CMD
command Description Windows version  

rmdir Deletes a directory. This must not contain any files, even All Win/DOS  
hidden ones. You can delete an entire directory tree with
the /S parameter (you can also use the rd command).

runas Allows a user to run commands with the rights of another 10/8/7/Vista/XP  
user. For example, you can run a command as an
administrator from a normal user account as long as you
know the password.

scandisk Starts Microsoft ScanDisk. The program searches data 98/95/DOS  


carriers for errors.

schtasks Sets the execution of specified programs and commands 10/8/7/Vista/XP  


for a specified point in time. You can create, delete,
change, and display all scheduled tasks.

set Displays environmental variables of CMD.EXE and lets All Win/DOS  


you configure them.

shift Moves variables within batch files and scripts. All Win/DOS  

shutdown Shuts down the computer (/s), triggers a restart (/r), or 10/8/7/Vista/XP  
logs the user out (/l). A graphical user interface is
displayed if you enter the parameter /I as the first option in
the command.

sort Lists out data (from a file or command) and outputs it All Win/DOS  
again sorted – directly in the command prompt, in a new
file, or in another output.

start Opens a new command prompt window in which you can All Win  
run a specific program or command.

subst Assigns a drive letter to a path to create a virtual drive. All Win/DOS  

taskkill Ends one or more running tasks. You either have to 10/8/7/Vista  
specify the process ID (PID) or image name.

tasklist Lists all running processes – also on remote computers, if 10/8/7/Vista/XP  


desired. The process ID also has to be specified, which is
required for the taskkill command, for example.

time Displays the current time and allows it to be changed. If All Win/DOS  
CMD
command Description Windows version  

the parameter /T is entered, the command prompt only


shows the time and offers no option to directly change it.

timeout Stops a process for a specified time. The command Is 10/8/7/Vista  


used in batch files and scripts. If you use the /NOBREAK
parameter, the command ignores any keyboard input.

title Changes the title of the command prompt. Spaces are All Win/DOS  
allowed, but not all special characters such as a slash, for
example, because they may be interpreted as instructions
for a parameter.

tree Graphically displays the directory structure of a drive or All Win/DOS  


path. With the /F parameter, all files in the folders are also
listed out. /A also ensures that only ASCII characters are
used for the graphical representation. The command takes
into account all subdirectories starting from the given path.
If you don’t enter a path, the current folder is used as the
output.

type Displays the content of a text file. All Win/DOS  

tzutil Displays the currently set time zone (/g) or changes it (/s). 10/8/7  
The parameter /l helps determine the valid time zones.

ver Displays the current version number of Windows or MS- All Win/DOS  
DOS.

Files

CMD Windows
command Description version

append Sets the path in which files will be searched for. 32-bit/DOS

assoc Changes the program that’s linked with a particular file ending. 10/8/7/Vista/XP

attrib Changes attributes of specified files. With the parameter +R you can All Win/DOS
protect a file from changes.

cipher Displays and changes the encryption status of files and directories on 10/8/7/Vista/XP
CMD Windows
command Description version

NTFS partitions.

comp Compares the content of two files or two file sets. The results can be 10/8/7/Vista/XP
displayed as a decimal value (/D) or with ASCII characters (/A).

compact Displays and changes the compression status of files and directories on 10/8/7/Vista/XP
NTFS partitions.

copy Copies a file or multiple files to another location. It’s also possible to All Win/DOS
connect several files to one. You can use the asterisk as a wild card.

cscript Runs scripts over the Microsoft Script Host. You can enable additional All Win/DOS
debugging with the /D option.

del Deletes a file or multiple files. If you also want to delete all files from All Win/DOS
subfolders, you can do this with the /S parameter. Read-only files can be
deleted with /F (you can also use the erase command).

deltree Deletes a directory as well as all subdirectories and files within. 98/95/DOS

diantz Compresses files without any loss (command has the same function as 7/Vista/XP
makecab).

diskcomp Compares the content of two disks. All Win (not


10)/DOS

diskcopy Copies the content of a disk to another. All Win (not


10)/DOS

endlocal Ends the valid range of changes to batch files or scripts. After the 10/8/7/Vista/XP
command, changes are applied to the entire system again (localization is
started with setlocal).

erase Function is the same as del. All Win/DOS

exe2bin Converts an EXE file to a BIN file. 32-bit

expand Extracts files and folders stored in CAB files. All Win (not 64-b
XP)/DOS

extrac32 Extracts files and folders stored in CAB files. The program is part of All Win
CMD Windows
command Description version

Internet Explorer, but can also be used in the command prompt.

extract Extracts files and folders stored in CAB files (in new Windows versions use 98/95
expand).

fc Compares two individual files or two sets of files with one another and All Win/DOS
displays the differences.

for Sets a specific command that should be run for each individual file in a file All Win/DOS
set. This command is usually used in batch and script files.

forfiles Selects one or more files and runs a command that refers to these files. 10/8/7/Vista
Usually used for batch and script files.

ftype Specifies a program for opening a specific file type. 10/8/7/Vista/XP

goto Skips the execution within a batch program to a specific line (marker). All Win/DOS

if Represents a conditional statement and executes expressions within batch All Win/DOS
files only under certain conditions. Can be extended by not if commands
are only not to be executed under certain conditions.

makecab Compresses files without loss in CAB format (you can also use the diantz 10/8/7/Vista/XP
command).

mklink Creates a symbolic link to a file. With /D you can also create connections to 10/8/7/Vista
directories. Create a fixed connection instead of a symbolic connection with
/H.

move Moves a file or multiple files from one directory to another. The command All Win/DOS
can also change the names of directories. By default, the command
overwrites other files with the same name when moving files to the
destination. To prevent this use the /-Y parameter.

openfiles Displays and separates open system files and folders. 10/8/7/Vista/XP

recover Restores readable files that were on a defective data drive. 10/8/7/Vista/XP

ren Changes the name of a particular file. Directory and drive cannot be All Win/DOS
changed this way (or use the rename command).

rename Function is the same as ren. All Win/DOS


CMD Windows
command Description version

replace Replaces the selected file or files with one or more other files. With /S files All Win/DOS
in subfolders are also replaced. With the addition /U files are only replaced
if another version is more current. The parameter /A allows users to add
new files to the target directory at the same time. This parameter is not
compatible with /S and /U.

robocopy Allows so-called robust file copying. This is an extended version of copy 10/8/7/Vista
and xcopy. With robocopy it’s possible to successfully transfer data even if
there are interruptions in the network. There are a total of 72 parameters
with which the copy command can be modified.

rsm Manages media on removable storage devices. Is used in batch files and Vista/XP
scripts to support programs that don’t use “Removable Storage API.”

setlocal Limits the valid range of changes to batch files or scripts. After the 10/8/7/Vista/XP
command, changes only apply to these files (localization is started with
endlocal).

share Installs file sharing and file locking. 32-bit/DOS

sxstrace Starts the WinSxs Tracing Utility, a tool for programming diagnostics. 10/8/7/Vista

takeown Restores administrator access rights to a file that have been lost when 10/8/7/Vista
reassigning a user.

undelete Undoes the deletion of a file. DOS

verify When enabled, checks whether files are written correctly on a data drive. All Win/DOS
The check is disabled in the standard settings.

where Finds files that match a particular search topic. The placeholders * and ? 10/8/7/Vista
can be used within the topic.

xcopy Copies files and entire directory structures. In this way, the command All Win/DOS
offers various additional options. For example, it can be specified that only
files younger than a specific date (/D) should be copied. It can also be
specified that read-only files are overwritten (/R).

System
CMD Windows
command Description version

at Starts commands and programs at a particular time. With the parameter 10/8/7/Vista/XP
/every:date[,…] you can also set regular appointments.

auditpol Displays current monitoring policies. 10/8/7/Vista

backup Creates backups of files. These can be recovered with restore (replaced DOS
by msbackup).

bcdboot Creates and repairs start files. 10/8/7

bcdedit Allows users to make changes to start configuration data storage (the 10/8/7/Vista
command is a new version of bootcfq).

bdehdcfg Prepares a hard drive for BitLocker Drive Encryption. 10/8/7

bootcfg Creates, edits, or displays the content of boot.ini (although it’s still 10/8/7/Vista/XP
included in the Windows 7 CMD, it has lost its function since boot.ini is no
longer used for startup options, instead you should use bcdedit).

bootsect Modifies the master boot code sot that it’s compatible with the Windows 10/8/7/Vista
Boot Manager or NT Loader (can only be started via system restore in
Windows 7 and Vista).

cacls Edits and displays the access control list. This sets access rights 10/8/7/Vista/XP
(outdated – replaced by icacls in newer Windows versions).

chkdsk Checks and repairs (with the parameter /R) a data drive. All Win/DOS

chkntfs Changes or displays the data driver check at startup. 10/8/7/Vista/XP

cmdkey Can display (/list), create (/add), or delete (/delete) login information. 10/8/7/Vista

convert Converts partitions from FAT/FAT32 to NTFS. 10/8/7/Vista/XP

ctty Changes the standard input and output for the system. 98/95/DOS

dblspace Creates or configures compresses drives (a newer version of the .98/95/DOS


command is called drvspace)

defrag Defragments all or only specified drives. Use /U to observe the progress. All Win/DOS
To get an evaluation statistic after the defragmentation, use the parameter
CMD Windows
command Description version

/V.

diskpart Manages, creates, and deletes partitions from the hard drive. 10/8/7/Vista/XP

diskperf Allows users to remotely control the disk performance counter. 10/8/7/Vista

diskraid Manages RAID systems. 10/8/7/Vista

dism Manages and integrates Windows images. 10/8/7

dispdiag Creates a file in the current directory in which you’ll find information about 10/8/7/Vista
your display.

dosx Starts the DOS Protected Mode Interface, which allows MS-DOS 32-Bit
programs more than 640 KB of RAM. Is only available to support older
DOS programs.

driverquery Creates a list with all installed drivers. 10/8/7/Vista/XP

drvspace Creates or configures compressed drives. An older version of the 98/95/DOS


command is called dblspace.

emm386 Provides DOS with more than 640 KB of RAM. 98/95/DOS

esentutl Manages databases within the extensible storage engine. 10/8/7/Vista/XP

eventcreate Creates an entry (ID and message) in an event log. 10/8/7/Vista/XP

eventtriggers Configures and displays event trigger. XP

fdisk Creates, deletes, and manages partitions on the hard drive. Use diskpart 98/95/DOS
in newer Windows versions.

fltmc Allows users to manage and display filter drivers. 10/8/7/Vista/XP

fondue Installs additional Windows features. The command is an abbreviation for 10/8
the underlying tool: Features on Demand User Experience Tool.

format Formats a drive to the file system specified by the user. All Win/DOS

fsutil Provides numerous features related to the file system, such as disk 10/8/7/Vista/XP
CMD Windows
command Description version

removal.

hwrcomp Compiles self-created dictionaries for handwriting recognition. 10/8/7

hwrreg Installs a compiled dictionary for handwriting recognition. 10/8/7

icacls Edits and displays the access control list. This sets access rights. An 10/8/7/Vista
outdated version of this command is cacls.

ktmutil Starts the kernel transaction manager. 10/8/7/Vista

label Changes or deletes a drive’s label. All Win/DOS

lh Loads a program into the high memory area (UMB) – has the same 98/95/DOS
function as loadhigh.

licensingdiag Creates an XML and a CAB file that contain information on the Windows 10/8
product license.

loadfix Ensures that a program is loaded and executed above the first 64 KB of 32-bit/DOS
RAM.

loadhigh Has the same function as lh. 98/95/DOS

lock Locks a drive so that only a user-selected program can access it directly. 98/95

lodctr Updates all registry entries that have to do with performance indicators. All Win

logman Creates and manages event trace sessions and performance logs. 10/8/7/Vista/XP

manage-bde Configures drive encryption with BitLocker. Use -on to encrypt a drive. 10/8/7
Use -off to decrypt it again and end BitLocker protection.

mem Displays information about the RAM and indicates which programs are 32-bit/DOS
currently loaded in it.

memmaker Optimizes the RAM. 98/95/DOS

mode Configures system devices – primarily on the COM or LPT port. All Win/DOS

mofcomp Analyzes files in managed object format (MOF) and adds the classes and All Win
CMD Windows
command Description version

instances to the WMI repository.

mountvol Creates and deletes mount points for drives and displays them. 10/8/7/Vista/XP

msav Starts Microsoft Antivirus. DOS

msbackup Starts Microsoft Backup (replaces backup and restores). DOS

mscdex Loads the CD-ROM support for MS-DOS. 98/95/DOS

msd Starts the program Microsoft Diagnostics, with which system information DOS
can be displayed.

msiexec Starts the Windows installer, with which Windows can be installed and 10/8/7/Vista/XP
configured.

muiunattend Starts an automatic setup process for the multilingual user interface (MUI). 10/8/7/Vista

netcfg Installs the minimal operating system Microsoft Windows PE. 10/8/7/Vista

ocsetup Installs additional Windows functions. 8/7/Vista

pentnt Recognizes floating point division errors in Pentium chips, starts floating XP
point emulation, and disables floating point hardware.

pkgmgr Installs, uninstalls, and configures packages and functions for Windows. 10/8/7/Vista

pnpunattend Automates the installation of device drivers. 10

pnputil Installs plug-and-play devices from the command prompt. 10/8/7/Vista

power Uses the IDLE status of a processor to reduce energy consumption. 98/95/DOS

powercfg Allows the user to change the computer’s energy options and control 10/8/7/Vista/XP
energy conservation plans.

pwlauncher Configures the startup options for Windows To Go with which you can 10/8
boot Windows from a USB drive.

qprocess Provides information on running processes. 10/8/7/Vista


CMD Windows
command Description version

query Displays the status of a particular service. 10/8/7/Vista

quser Provides information on the currently logged-in users. 10/8/7/Vista

reagentc Configures the Windows recovery environment, with which you can repair 10/8/7
the installation of the operating system.

recimg Creates a user-defined Windows image to restore the system. 8

reg Manages the registry of the command prompt. Users can create new keys 10/8/7/Vista/XP
(reg add) or delete them (reg delete).

regini Changes registry authorizations. 10/8/7/Vista/XP

register- Registers a common information model provider (CIM provider) in 10/8


cimprovider Windows.

regsvr32 Registers a DLL file in the registry. 10/8/7/Vista/XP

relog Creates new performance indicator protocols from the data in the existing 10/8/7/Vista/XP
protocols.

repair-bde Repairs and decrypts defective drives that are encrypted with BitLocker. 10/8/7
The files should be saved on a replacement drive.

reset Resets a session. You can also use the rwinsta command. 10/8/7/Vista/XP

restore Restores backups that were created with the backup command (replaced DOS
by msbackup).

rwinsta Command has the same function as reset. 10/8/7/Vista/XP

sc Manages services by connecting to the Service Controller. 10/8/7/Vista/XP

scanreg Repairs the registry and allows a backup to be created of it. 98/95

sdbinst Applies user-defined database files (SDB). 10/8/7/Vista/XP

secedit Analyzes the security settings by comparing the current configurations 10/8/7/Vista/XP
with templates. Settings can also be configured, imported, and exported
with this command.
CMD Windows
command Description version

setver Sets a version number of MS-DOS that’s forwarded to a program – even if 32-bit/DOS
it doesn’t match the actual version.

setx Creates or changes environmental variable in the user of system 10/8/7/Vista


environment.

sfc Checks all important and protected system files. Incorrect versions are 10/8/7/Vista/XP
replaced by correct ones.

smartdrv Starts and manages the hard drive cache program SMARTDrive. 98/95/DOS

sys Copies system files from MS-DOS and the command interpreter to 98/95/DOS
another hard drive. This makes it bootable.

systeminfo Displays information about the Windows installation, including all installed 10/8/7/Vista/XP
service packages. The information can be obtained from the local system
as well as a remote computer.

tpmvscmgr Creates and deletes TPM virtual smart cards. These are virtual 10/8
smartcards encrypted on the basis of the Trusted Platform Model.

tracerpt Processes logs or real-time data generated during the tracing of computer 10/8/7/Vista/XP
programs.

typeperf Displays performance counter data or writes it into a file. 10/8/7/Vista/XP

unformat Undoes the drive formatting done by the format command. DOS

unlock Unlocks a drive that was locked with the lock command. 98/95

unlodctr Deletes names as well as descriptions for extensible performance 10/8/7/Vista/XP


counters in the Windows registry.

vaultcmd Creates, deletes, and displays saved registration information. 10/8/7

vol Displays the label and serial number of a drive. All Win/DOS

vsafe Starts the antivirus software VSafe. DOS

vssadmin Manages the volume shadow copy services that can be used to store 10/8/7/Vista/XP
different versions (snapshots) of drives.
CMD Windows
command Description version

wbadmin Creates backups of the operating system and delivers information to the 10/8/7/Vista
created backup copies.

wevtutil Manages event logs and event log files. 10/8/7/Vista

whoami Provides information about the current user. With the /GROUP parameter 10/8/7/Vista
you can obtain additional information about group membership.

winmgmt Manages WMI repositories. Backups (/backup) are possible with the All Win
command, for example.

winsat Evaluates various system factors – for example, processor performance 10/8/7/Vista
or graphical capabilities.

wmic Starts the Windows Management Instrumentation in the command 10/8/7/Vista/XP


prompt. Various Windows settings can be changed here – both locally and
on remote computers.

xwizard Registers Windows data in the form of XML files. 10/8/7

Network

CMD Windows
command Description version

arp Displays and edits entries in the Address Resolution Protocol cache. All Win

atmadm Displays information on asynchronous transfer mode (ATM). XP

certreq Manages and creates certificate registration requirements for 10/8/7/Vista


certification authorities.

certutil Manages services related to certificate authentication. 10/8/7/Vista

change Changes the settings of a terminal server and can be used together with 10/8/7/Vista
the parameters logon, port, or user (replaces the commands chglogon,
chgport, and chgusr).

checknetisolation Checks the network capability of apps from the Windows Store. 10/8

chglogon Enables, disables, or adjusts logins for terminal server sessions. 10/8/7/Vista
CMD Windows
command Description version

chgport Displays or changes the COM pin assignment of terminal servers for 10/8/7/Vista
DOS compatibility.

chgusr Changes the installation mode of a terminal server. 10/8/7/Vista

cmstp Installs or uninstalls profiles for the connection manager. 10/8/7/Vista/XP

djoin Creates a new computer account in the Active Directory Domain 10/8/7/Vista
Services (AD DS).

finger Provides information about users on remote devices using the Finger 10/8/7/Vista/XP
service.

ftp Transfers data to an FTP server or from this to a PC. The command All Win/DOS
offers additional options: For example, you can activate debugging with
-d.

getmac Displays the MAC address of all network adapters. The format of the 10/8/7/Vista/XP
output (Table, List, CSV) is set with /FO. With /S you can use the
command on remote systems as well.

gpresult Displays information on the Group Policy. 10/8/7/Vista/XP

gpupdate Updates information on the Group Policy. 10/8/7/Vista/XP

hostname Outputs the name of the current host. 10/8/7/Vista/XP

interlnk Connects two computers via serial or parallel connection to share files DOS
or printers.

intersvr Starts an interlnk server and transfers data from one computer to DOS
another via serial or parallel connection.

ipconfig Provides information on the IP of each used network adapter. The All Win/DOS
command can also be used to release (/release) or renew (/renew)
addresses. With /flushdns you can clear the DNS cache.

ipxroute Changes and displays information on the IPX routing tables. XP

irftp Transfers files via infrared connection, if one is available. 10/8/7/Vista


CMD Windows
command Description version

iscsicli Manages iSCSI, which enables connections via the SCSI protocol. 10/8/7/Vista

klist Displays all tickets authenticated by the Kerberos service. Also enables 10/8/7
the command to delete tickets (purge).

ksetup Configures a connection to a Kerberos server. 10/8/7

mount Enables network sharing under the Network File System. (To use the 7/Vista
command, enable NFS services).

mrinfo Provides information on the router. 10/8/7/Vista/XP

nbtstat Displays statistics and information on the TCP/IP connections on remote 10


computers.

net Configures and displays network settings. All Win

net1 Configures and displays network settings (it’s recommended to use net 10/8/7/Vista/XP
instead; the net1 command is only intended as a temporary solution for
a Y2K problem).

netsh Starts the network shell, which allows for network settings to be 10/8/7/Vista/XP
changed on local and remote computers.

netstat Displays statistics and information on TCP/IP connections on the local All Win
computer.

nfsadmin Manages NFS servers and clients (to be able to use the command, you 7/Vista
first have to enable NFS services in Windows).

nltest Displays information related to secure channels in the Active Directory 10/8/7
Domain Services (AD DS) and tests the connections.

nslookup Sends a DNS query to a specific IP or host name on the preconfigured 10


DNS server. You can also specify another DNS server.

ntsd Runs debugging. XP

pathping Provides information on forwarding and package loss when sending 10/8/7/Vista/XP
CMD Windows
command Description version

over a network and also specifies the latency.

ping Sends an internet control message protocol echo request to a specific All Win
host to check if it’s accessible. The duration of the echo can also be
specified. Ping signals can be sent continuously with -t. To display
statistics on this action, press Ctrl + Brk. Cancel the process with Ctrl +
C.

qappsrv Displays all available remote computers in the network. 10/8/7/Vista/XP

qwinsta Displays information on the open remote desktop sessions. 10/8/7/Vista

rasautou Manages autodial addresses. 10/8/7/Vista/XP

rasdial Starts and ends network connections for Microsoft clients. 10/8/7/Vista/XP

rcp Copies files from a Windows computer to a server that’s running a 7/Vista/XP
RSDH daemon, and vice versa.

rdpsign Signs a remote desktop protocol file (RDP file). 10/7

rexec Runs commands on a remote computer that’s running a Rexec daemon. Vista/XP

route Displays routing tables and makes it possible to change, add, or delete All Win
entries.

rpcinfo Sends a remote procedure call (RPC) to an RPC server. The result 7/Vista
displays the programs on the remote computer (to use the command,
NFS services on Windows have to be enabled first).

rpcping Sends a ping via remote procedure call (RPC) and checks whether a 10/8/7/Vista
connection is possible.

rsh Runs commands on remote computers that are running the Unix 7/Vista/XP
program Remote Shell (RSH).

setspn Creates, deletes, and changes SPNs. These are unique identifiers for 10/8/7
services on a network that uses Kerberos authentication.

shadow Monitors a session on a remote computer. The user can also actively 7/Vista/XP
control the remote computer.
CMD Windows
command Description version

showmount Provides information on NFS file systems (to use the command, you first 7/Vista
have to activate NFS services in Windows).

tcmsetup Enables or disables a client for the Telephony Application Programming 10/8/7/Vista/XP
Interface (TAPI), a programming interface for telephone applications.

telnet Enables communication with another computer that also uses the telnet All Win/DOS
protocol.

tftp Enables a file exchange between the local computer and a server that 10/8/7/Vista/XP
supports the Trivial File Transfer Protocol (TFTP). To use the command,
the TFTP client first needs to be enabled in the system settings.

tlntadmn Manages a telnet server on a local or remote computer (to be able to 8/7/Vista/XP
use the command, the telnet server functions first have to be enabled in
the system settings).

tracert Tracks a data package on the way through the network to a server. It All Win
doesn’t only check whether the package arrives and how long it takes,
but also records how many hops the package makes on the way. All
packages have a set time-to-live (TTL), which is increased gradually
with the command.

tscon Connects the current local user session with a session on a remote 10/8/7/Vista/XP
computer.

tsdiscon Ends the connection between a local user session and a session on a 10/8/7/VistaXP
remote computer.

tskill Ends a process on a remote computer. 10/8/7/Vista/XP

tsshutdn Shuts down or restarts a remote terminal server. If the target computer XP
supports it, the entire computer can be turned off in this way.

umount Removes mounted network file system drives. To use the command, the 7/Vista
NFS functions first have to be enabled in the system settings.

w32tm Manages the Windows time service that synchronizes dates and times 10/8/7/Vista/XP
on all computers that share an AD DS domain.

waitfor Sends or waits on a single. If the signal is only supposed to be sent to 10/8/7/Vista
specified computers in a domain instead of all, use the /S parameter.
Computers within a network are synchronized with one another through
CMD Windows
command Description version

this command.

wecutil Creates and managements subscriptions for events. These are 10/8/7/Vista
forwarded from remote event sources that support the WS management
protocol.

winrm Manages secure connections between local and remote computers via 10/8/7/Vista
the WS management protocol.

winrs Enables access to the command line of a remote computer via a secure 10/8/7/Vista
connection to implement changes. If you want to disable encryption, use
-un.

wsmanhttpconfig Manages functions of the Windows Remote Management (winrm). 10/8/7/Vista

 Tip
At this point, Windows knows three different commands for copying files and directories. But the
range of functions of the individual Windows CMD commands have been partially extended: For
example, xcopy is stronger than copy, and robocopy in turn has a larger scope than xcopy. If
you’re using a newer version of Windows (Vista or later), it’s best to use the robocopy command
in the command prompt.

  01.10.20
 Know-how


o
o
o
o

 Tutorials
 Operating Systems
 Windows
Related articles
Windows blue screen (BSOD): How to cure the error
  27.02.2019
 Know-how

The infamous blue screen of death usually shows up without any warning. It’s an important
indicator of internal problems with hardware, software, or drivers. If Windows can no longer be
run as a result of such a problem, then the forced shutdown takes place in the form of a blue
screen containing an error message. This may cause unsaved files and documents to be lost.
The most important thing with...



nslookup: Here’s how the useful DNS check works


  13.08.2019
 Tools

Those who want to access computer systems and applications in networks need host (or rather,
domain) names. As long as the Domain Name System, which is responsible for the name
conversions, is functioning normally, users remain unaware that machine-readable IP addresses
are hidden behind these names. However, if complications with the DNS and the involved name
servers arise, they can be quickly...



Windows.old: explanation and instructions for deleting the folder


  18.08.2020
 Configuration

Windows offers a variety of features to ensure that the system functions over the long term. For
example, the operating system generates a backup folder called Windows.old during new
installations, upgrades or major updates which can be used to restore the system to its previous
state. In our article, you will learn about the circumstances in which you can remove Windows.old
and how to do so.




Shutdown via CMD: An overview of windows shutdown commands
  16.09.2020
 Configuration

In Windows, you can adapt frequently required shutdown routines to your individual needs in
many different ways. For this, Windows provides an appropriate tool in the command line, which
is also referred to as the prompt – CMD or cmd.exe. We introduce shutdowns via CMD, which
can handle efficient, simple, but also more complex shutdown routines.



Opening Command Prompt in Windows: the most popular options


  30.09.2020
 Tools
Command Prompt in Windows is used to enter command line instructions. The Microsoft
operating system provides several options to launch Command Prompt. The method you choose
ultimately depends on your personal user habits. You can also open Command Prompt in a
special mode with administrator privileges if required for certain system tasks.



Related products

Domain Transfer
See packages 

Web hosting for agencies


Provide powerful and reliable service to your clients with a web hosting package from IONOS.

View packages 

Popular Articles
Create a hair salon website
We’ll show you how to quickly, easily and affordably create a professional hair salon
website...

Build a real estate website


With a real estate website, you can set yourself apart from the competition...

Handyman website
With the right tools, a homepage for tradesmen can be created quickly and legally
compliant...

Create dental website


Patients can easily find you online and gain an overview of your clinic’s services and
offers...

Build a photography website


In this article, we’ll give you an overview of what components a website for
photographers should have...


 

 About 1&1

 Terms and Conditions

 Privacy Policy

 Help Center

 Tell a friend

 © 2021 IONOS Inc.

o. For this reason, we’ll explain what the command line is, how to open it, and which CMD commands
there are for Windows.

Windows console commands have changed over time: in newer Windows versions, users no longer

have access to some of the familiar commands. In the following, we’ll explain which CMD

CMD commands
commands still work under Windows 10 so that you don’t h

for the Windows command prompt


Most IT experts and Linux users, in addition to computer users who work with MS-DOS, are relatively
familiar with the command line and its corresponding commands. But a lot can be achieved with
the command prompt in Windows, too. For this reason, we’ll explain what the command line is, how to
open it, and which CMD commands there are for Windows.

Windows console commands have changed over time: in newer Windows versions, users no longer have
access to some of the familiar commands. In the following, we’ll explain which CMD commands still
work under Windows 10 so that you don’t have to tediously test which are still valid and which are
outdated. Our overview tables describe the functions of the individual commands and specify under which
Microsoft operating systems they’re effective.

Contents
1. How does a command line work?
2. How do you open the command prompt?
3. How do you enter commands in the command prompt?
4. Windows CMD commands: an overview

How does a command line work?


The command line (also called the console or terminal) is a text-based interface within the operating
system, that forwards commands from the user to the operating system. This makes it possible, for
example, to organize files, start programs, or run other commands linked to the operating system,
computer, or network.

In older operating systems (like MS-DOS), you had to work without a graphical user interface, and
oftentimes even navigate without a mouse. Instead, you had to type in all commands – the directory
structures were then displayed as plain text on the screen. But even after the switch to graphical operating
systems, the command line remained text-based.

In general, the connection between operating system – regardless of whether graphical (GUI = graphical
user interface) or text-based (CLI = command line interpreter) was condensed under the term “Shell.” The
default command line interpreter for Windows is called CMD.EXE. In addition, however, there’s also the
“PowerShell”: This offers more options than CMD.EXE. For example, automations can be created better
with PowerShell. In this way, users can create script programs with the PowerShell scripting language.

 Note
Many Windows console commands are based on batch files. This are usually text files (with the ending
.bat or .cmd) that are run by the command line as batch processing. These files are generally created to
perform routine work and start other programs.

$1 Domain Names
Register great TLDs for less than $1 for the first year.

Why wait? Grab your favorite domain name today!

Matching email
SSL certificate

24/7/365 support

Save Now

How do you open the command prompt?


There are various options for accessing the command line in Windows. Technically speaking, the
command line is the CMD.EXE program. This executable file should be found in the system directory of
your Windows folder. (If you right-click on the file, Windows also gives you the option to start the
program as an administrator – in case you have the access data for this.) To reach the program more
quickly, you can use the search bar or the run menu. The latter is opened under Windows 7, 8, and 10 with
the key combination Win + R. Then all you have to do is type “cmd” into the search field and press the OK
button.

The command prompt has long had a fixed spot in the Windows start menu as well. Under Windows 7
and Windows 10, the program is found in the “System Tools” folder. With Windows 8, Microsoft replaced
the start menu with a start screen. But the command prompt is also found via the apps here. Alternatively,
Windows 8 as well as Windows 10 both offer the “Power User Tasks Menu.” You can open this with the
key combination Win + X. In this way, you can find the command prompt in the normal execution as well
as the administrator version.

How do you enter commands in the command prompt?


CMD functions via defined commands. These have to be entered correctly, otherwise the command
prompt can’t run the task. The same goes for parameters that you link to the commands. Individual
commands can be extended using options (such as arguments). These are generally given as a letter with a
minus sign (-), plus sign (+), or slash (/). CMD also allows placeholders. For so-called wild cards, use an
asterisk (*) or question mark (?). While the latter replaces a single character (i.e. letter, digit, or other
character), the asterisk stands for any number of characters.

 Note
In the command prompt and commands, you also frequently have to work with path specifications. You
need these to navigate through your directories or specify exact positions in commands. For the input of a
path, use the backslash (\).
Individual CMD commands can be combined with one another. Through a pipe, the output of the first
command is interpreted as input for the following command. In the command prompt, commands are
linked to one another with a vertical line (|). This line itself is called a pipe, but officially is known as a
vertical bar. Vertical bars pass data from one command to the next:

 CommandA | CommandB

There’s also the possibility of redirection: where the output of a command is directly forwarded to a file
(>) or the content of a text file is understood as input for the command (<).

 Command > File (output in file)


 Command < File (input from file)

Finally, Windows command line commands can also be connected in such a way that they run directly
after one other. This can be controlled via a relatively simple form (&), but also via two more complex
variations. It’s also possible to only run the second command if the first was successful. Or, you can set up
the exact opposite as well: The second command is only run if the first doesn’t work (||). Both options can
even be combined so that there’s an either-or string of commands:

 CommandA & CommandB (the second command is run directly after the first)
 CommandA && CommandB (the second command is only run if the first was successful)
 Command A || CommandB (the second command is only run if the first was not successful)
 CommandA && CommandB || CommandC (the second command is only run if the first was
successful, otherwise the third command is run)

 Tip
Each command has its own syntax and individual options. So that you don’t have to memorize all of these,
CMD offers a help command: Using help command or command /? you can obtain information about how
to handle the command.
It’s also extremely helpful that the command prompt remembers your last entered CMD commands. Using
the up and down arrow keys on the keyboard, you can recall your earlier entries. This also means,
though, that you can’t use these keys to scroll through the CMD window. This is usually done with the
mouse instead. But if you prefer to scroll using keys and are ready to give up the recall command function,
you can alter the corresponding setting: right-click on the command prompt and enable the “Scrolling”
option.

Command, file names or path specifications, as well as arguments, are separated from one another using
spaces. It also usually doesn’t matter if you use upper- or lower-case letters. It’s only important in a few
cases whether you write the parameter in upper- or lower-case (generally only when two different
parameters are abbreviated with the same letter, and are only differentiated from one another through the
case).

3 ways to be present and grow online


Get found with your own domain. Build trust with your own email address. Reach visitors with your own
website.
Buy a domain

Get custom email

Create a website

Windows CMD commands: an overview


There are almost 300 commands for Windows and its predecessor, MS-DOS. Over the decades, some
commands have been kept around, some have only recently been added with newer versions of Windows,
and others have been removed or replaced. In our comprehensive list, we explain what the different
commands mean and on which Windows versions they run. This way, you can quickly look up whether the
CMD commands that you know still function with Windows 10. To make it more clear, we’ve divided the
Windows command prompt commands into four categories: basics, files, system, and network.

 Note
The information on the functionality of various Windows versions should only be understood as
orientation information. For the individual commands, it’s not only which Windows version you’re using
that’s important, but also which edition (Home, Pro, Server). In some cases, you have to adjust certain
settings beforehand so that the commands are effective. You also will need access rights as an
administrator for some CMD commands.
Basics

CMD
command Description Windows version  

bitsadmin Creates and monitors downloads and uploads. 10/8/7/Vista  

break Interrupts Ctrl + C checking in DOS, allowing you to stop All Win/DOS  
processes in the old operating system. Only available for
compatibility reasons in Windows.

call Calls a batch file within another batch file. The command All Win/DOS  
has no effect if entered directly into CMD instead of in a
batch file.

cd Displays the current directory and lets you switch to other All Win/DOS  
directories. With the parameter /D plus drive and path
specification, you can also switch drives. Use cd.. to
switch to a higher directory (has the same function as the
CMD
command Description Windows version  

chdir command).

chcp Changes the current code page (character set table) or All Win/DOS  
shows the page count of the current code page.

chdir Displays the current directory and lets you switch to other All Win/DOS  
directories. With the parameter /D plus drive and path
specification, you can also switch drives. Use chdir.. to
switch to a higher directory (has the same function as the
cd command).

choice Creates a selection list: typical example is the selection of All Win (not XP)/DOS  
yes (Y) or no (N), which is created with /C YN. With the
parameter /M you can add an explanatory message for
the user.

clip Forwards the result of a command to the clipboard. For clip) or the content of 10/8/7/Vist
example, you can copy the directory structure (dir a file (clip < filename)
to the clipboard.

cls Clears the content of the screen. All Win/DOS  

cmd Starts CMD.EXE. 10/8/7/Vista/XP  

color Changes the background (first value) and text color 10/8/7/Vista/XP  
(second value) of the command prompt. The color lies
between 0 (black) and F (white).

command Starts CMD.COM. 32-bit/DOS  

date Displays the current date and allows you to change it. All Win/DOS  
With the parameter /T the date is shown without the option
to change.

debug Starts debug, a program that can test and modify 32-bit/DOS  
programs within the command prompt.

dir Displays all folders and files within the current directory. All Win/DOS  
You can restrict the output by attributes (/A), simplify the
list (/B), or display all subdirectories and their files (/S).

doskey Creates macros, recalls commands, and edits command All Win/DOS  
CMD
command Description Windows version  

input.

dosshell Opens the DOS shell, a graphical file management tool. In 95/DOS  
Windows, the DOS shell is replaced by Windows Explorer.

echo Displays a message and is mainly used within scripts and All Win/DOS  
batch files.

edit Starts the MS-DOS editor, with which you can create text 32-bit/DOS  
files.

edlin Creates and edits text files within the command prompt. 32-bit/DOS  

exit Ends CMD.EXE or CMD.COM. All Win/DOS  

fasthelp Displays helpful information about commands. DOS  

fastopen Writes the position of a program into a specified list, which 32-bit/DOS  
is in the working memory and should accelerate the start
of programs.

find Searches through a file or multiple files for a particular All Win/DOS  
character sequence. If you only want to know how
frequently the word or phrase occurs, use the /C
parameter. With the extension /I the command ignores
upper- and lower-case in the search.

findstr Finds character sequences in one or multiple files. It gives 10/8/7/Vista/XP  


you more options when compared to the find command:
you can search for files that contain various terms or
with /C search for an exact word order.

forcedos Starts a program in the MS-DOS partial system, in case XP (32-bit)  


it’s not directly recognized by Windows XP as a DOS
program.

graftabl Enables the option to use extended characters of a 32-bit/DOS  


specific code page in graphics mode.

graphics Starts a program that can print graphics. 32-bit/DOS  

help Displays help text for a specific command (you can also All Win/DOS  
CMD
command Description Windows version  

use the /? command).

kb16 Changes the country settings of the keyboard for DOS 32-bit  
programs (only included in Windows for compatibility
reasons. Replaces the old command keyb).

keyb Changes the country settings of the keyboard for DOS 98/95/DOS  
programs (only included in Windows for compatibility
reasons. Replaced by kb16 in newer Windows versions).

logoff Logs the user out of Windows. Also allows you to end 10/8/7/Vista/XP  
sessions on servers.

lpq Displays the status of a printer queue for computers that All Win  
use a “line Printer Daemon” (LPD). (To use the command
in Windows 10, 8, 7, or Vista, the LPD print service and
the LPR port monitor have to be enabled first).

lpr Sends a file to a computer that uses a line printer daemon All Win  
(LPD). To use the command in Windows 10, 8, 7, or Vista,
the LPD print service and LPR port monitor have to be
enabled first.

md Creates a new directory on the specified path. If All Win/DOS  


directories don’t already exist on the path, md creates
them automatically (you can also use the mkdir
command).

mkdir Creates a new directory on the specified path. If All Win/DOS  


directories don’t already exist on the path, mkdir creates
them automatically (you can also use the md command).

more Outputs the content of a file (for example, a text file) by All Win/DOS  
the page. You can also use the command to split the
output of another command into pages.

msg Sends a message to another user. You can write the 10/8/7/Vista/XP  
username into the command or create files in which
usernames are saved. The files can then be included in
the command with @filename.

nlsfunc Provides country-specific information for language 32-bit/DOS  


CMD
command Description Windows version  

support.

ntbackup Runs backup services directly from the command line or XP  


as part of batch or script files.

path Creates and displays the path for searching executable All Win/DOS  
files.

pause Pauses execution in batch files and scripts. The user is All Win/DOS  
then prompted in a message to continue by pressing a
key.

popd Changes to the folder saved by the pushd command. The 10/8/7/Vista  
command is mainly part of batch files and scripts.

print Prints a text file. The device to be used for printing has to All Win/DOS  
be specified.

prompt Changes the display of the command prompt. All Win/DOS  

pushd Saves a specific path into a script or batch file. You can 10/8/7/Vista/XP  
change to this directory with popd.

qbasic Starts qbasic, a program environment based on the 98/95/DOS  


BASIC programming language.

rd Deletes a directory. This must not contain any files, even All Win/DOS  
hidden ones. You can delete an entire directory tree with
the /S parameter (you can also use the rmdir command).

rem Writes comments in batch and script files that aren’t taken All Win/DOS  
into account when executing.

rmdir Deletes a directory. This must not contain any files, even All Win/DOS  
hidden ones. You can delete an entire directory tree with
the /S parameter (you can also use the rd command).

runas Allows a user to run commands with the rights of another 10/8/7/Vista/XP  
user. For example, you can run a command as an
administrator from a normal user account as long as you
know the password.
CMD
command Description Windows version  

scandisk Starts Microsoft ScanDisk. The program searches data 98/95/DOS  


carriers for errors.

schtasks Sets the execution of specified programs and commands 10/8/7/Vista/XP  


for a specified point in time. You can create, delete,
change, and display all scheduled tasks.

set Displays environmental variables of CMD.EXE and lets All Win/DOS  


you configure them.

shift Moves variables within batch files and scripts. All Win/DOS  

shutdown Shuts down the computer (/s), triggers a restart (/r), or 10/8/7/Vista/XP  
logs the user out (/l). A graphical user interface is
displayed if you enter the parameter /I as the first option in
the command.

sort Lists out data (from a file or command) and outputs it All Win/DOS  
again sorted – directly in the command prompt, in a new
file, or in another output.

start Opens a new command prompt window in which you can All Win  
run a specific program or command.

subst Assigns a drive letter to a path to create a virtual drive. All Win/DOS  

taskkill Ends one or more running tasks. You either have to 10/8/7/Vista  
specify the process ID (PID) or image name.

tasklist Lists all running processes – also on remote computers, if 10/8/7/Vista/XP  


desired. The process ID also has to be specified, which is
required for the taskkill command, for example.

time Displays the current time and allows it to be changed. If All Win/DOS  
the parameter /T is entered, the command prompt only
shows the time and offers no option to directly change it.

timeout Stops a process for a specified time. The command Is 10/8/7/Vista  


used in batch files and scripts. If you use the /NOBREAK
parameter, the command ignores any keyboard input.

title Changes the title of the command prompt. Spaces are All Win/DOS  
allowed, but not all special characters such as a slash, for
CMD
command Description Windows version  

example, because they may be interpreted as instructions


for a parameter.

tree Graphically displays the directory structure of a drive or All Win/DOS  


path. With the /F parameter, all files in the folders are also
listed out. /A also ensures that only ASCII characters are
used for the graphical representation. The command takes
into account all subdirectories starting from the given path.
If you don’t enter a path, the current folder is used as the
output.

type Displays the content of a text file. All Win/DOS  

tzutil Displays the currently set time zone (/g) or changes it (/s). 10/8/7  
The parameter /l helps determine the valid time zones.

ver Displays the current version number of Windows or MS- All Win/DOS  
DOS.

Files

CMD
command Description Windows version

append Sets the path in which files will be searched for. 32-bit/DOS

assoc Changes the program that’s linked with a particular file ending. 10/8/7/Vista/XP

attrib Changes attributes of specified files. With the parameter +R you can All Win/DOS
protect a file from changes.

cipher Displays and changes the encryption status of files and directories on 10/8/7/Vista/XP
NTFS partitions.

comp Compares the content of two files or two file sets. The results can be 10/8/7/Vista/XP
displayed as a decimal value (/D) or with ASCII characters (/A).

compact Displays and changes the compression status of files and directories on 10/8/7/Vista/XP
NTFS partitions.

copy Copies a file or multiple files to another location. It’s also possible to All Win/DOS
CMD
command Description Windows version

connect several files to one. You can use the asterisk as a wild card.

cscript Runs scripts over the Microsoft Script Host. You can enable additional All Win/DOS
debugging with the /D option.

del Deletes a file or multiple files. If you also want to delete all files from All Win/DOS
subfolders, you can do this with the /S parameter. Read-only files can be
deleted with /F (you can also use the erase command).

deltree Deletes a directory as well as all subdirectories and files within. 98/95/DOS

diantz Compresses files without any loss (command has the same function as 7/Vista/XP
makecab).

diskcomp Compares the content of two disks. All Win (not


10)/DOS

diskcopy Copies the content of a disk to another. All Win (not


10)/DOS

endlocal Ends the valid range of changes to batch files or scripts. After the 10/8/7/Vista/XP
command, changes are applied to the entire system again (localization is
started with setlocal).

erase Function is the same as del. All Win/DOS

exe2bin Converts an EXE file to a BIN file. 32-bit

expand Extracts files and folders stored in CAB files. All Win (not 64-bit
XP)/DOS

extrac32 Extracts files and folders stored in CAB files. The program is part of All Win
Internet Explorer, but can also be used in the command prompt.

extract

CMD commands for the Windows


command prompt
Most IT experts and Linux users, in addition to computer users who work with MS-DOS, are relatively
familiar with the command line and its corresponding commands. But a lot can be achieved with
the command prompt in Windows, too. For this reason, we’ll explain what the command line is, how to
open it, and which CMD commands there are for Windows.

Windows console commands have changed over time: in newer Windows versions, users no longer have
access to some of the familiar commands. In the following, we’ll explain which CMD commands still
work under Windows 10 so that you don’t have to tediously test which are still valid and which are
outdated. Our overview tables describe the functions of the individual commands and specify under which
Microsoft operating systems they’re effective.

Contents
1. How does a command line work?
2. How do you open the command prompt?
3. How do you enter commands in the command prompt?
4. Windows CMD commands: an overview

How does a command line work?


The command line (also called the console or terminal) is a text-based interface within the operating
system, that forwards commands from the user to the operating system. This makes it possible, for
example, to organize files, start programs, or run other commands linked to the operating system,
computer, or network.

In older operating systems (like MS-DOS), you had to work without a graphical user interface, and
oftentimes even navigate without a mouse. Instead, you had to type in all commands – the directory
structures were then displayed as plain text on the screen. But even after the switch to graphical operating
systems, the command line remained text-based.

In general, the connection between operating system – regardless of whether graphical (GUI = graphical
user interface) or text-based (CLI = command line interpreter) was condensed under the term “Shell.” The
default command line interpreter for Windows is called CMD.EXE. In addition, however, there’s also the
“PowerShell”: This offers more options than CMD.EXE. For example, automations can be created better
with PowerShell. In this way, users can create script programs with the PowerShell scripting language.

 Note
Many Windows console commands are based on batch files. This are usually text files (with the ending
.bat or .cmd) that are run by the command line as batch processing. These files are generally created to
perform routine work and start other programs.

$1 Domain Names
Register great TLDs for less than $1 for the first year.

Why wait? Grab your favorite domain name today!


Matching email

SSL certificate

24/7/365 support

Save Now

How do you open the command prompt?


There are various options for accessing the command line in Windows. Technically speaking, the
command line is the CMD.EXE program. This executable file should be found in the system directory of
your Windows folder. (If you right-click on the file, Windows also gives you the option to start the
program as an administrator – in case you have the access data for this.) To reach the program more
quickly, you can use the search bar or the run menu. The latter is opened under Windows 7, 8, and 10 with
the key combination Win + R. Then all you have to do is type “cmd” into the search field and press the OK
button.

The command prompt has long had a fixed spot in the Windows start menu as well. Under Windows 7
and Windows 10, the program is found in the “System Tools” folder. With Windows 8, Microsoft replaced
the start menu with a start screen. But the command prompt is also found via the apps here. Alternatively,
Windows 8 as well as Windows 10 both offer the “Power User Tasks Menu.” You can open this with the
key combination Win + X. In this way, you can find the command prompt in the normal execution as well
as the administrator version.

How do you enter commands in the command prompt?


CMD functions via defined commands. These have to be entered correctly, otherwise the command
prompt can’t run the task. The same goes for parameters that you link to the commands. Individual
commands can be extended using options (such as arguments). These are generally given as a letter with a
minus sign (-), plus sign (+), or slash (/). CMD also allows placeholders. For so-called wild cards, use an
asterisk (*) or question mark (?). While the latter replaces a single character (i.e. letter, digit, or other
character), the asterisk stands for any number of characters.

 Note
In the command prompt and commands, you also frequently have to work with path specifications. You
need these to navigate through your directories or specify exact positions in commands. For the input of a
path, use the backslash (\).
Individual CMD commands can be combined with one another. Through a pipe, the output of the first
command is interpreted as input for the following command. In the command prompt, commands are
linked to one another with a vertical line (|). This line itself is called a pipe, but officially is known as a
vertical bar. Vertical bars pass data from one command to the next:

 CommandA | CommandB

There’s also the possibility of redirection: where the output of a command is directly forwarded to a file
(>) or the content of a text file is understood as input for the command (<).

 Command > File (output in file)


 Command < File (input from file)

Finally, Windows command line commands can also be connected in such a way that they run directly
after one other. This can be controlled via a relatively simple form (&), but also via two more complex
variations. It’s also possible to only run the second command if the first was successful. Or, you can set up
the exact opposite as well: The second command is only run if the first doesn’t work (||). Both options can
even be combined so that there’s an either-or string of commands:

 CommandA & CommandB (the second command is run directly after the first)
 CommandA && CommandB (the second command is only run if the first was successful)
 Command A || CommandB (the second command is only run if the first was not successful)
 CommandA && CommandB || CommandC (the second command is only run if the first was
successful, otherwise the third command is run)

 Tip
Each command has its own syntax and individual options. So that you don’t have to memorize all of these,
CMD offers a help command: Using help command or command /? you can obtain information about how
to handle the command.
It’s also extremely helpful that the command prompt remembers your last entered CMD commands. Using
the up and down arrow keys on the keyboard, you can recall your earlier entries. This also means,
though, that you can’t use these keys to scroll through the CMD window. This is usually done with the
mouse instead. But if you prefer to scroll using keys and are ready to give up the recall command function,
you can alter the corresponding setting: right-click on the command prompt and enable the “Scrolling”
option.

Command, file names or path specifications, as well as arguments, are separated from one another using
spaces. It also usually doesn’t matter if you use upper- or lower-case letters. It’s only important in a few
cases whether you write the parameter in upper- or lower-case (generally only when two different
parameters are abbreviated with the same letter, and are only differentiated from one another through the
case).
3 ways to be present and grow online
Get found with your own domain. Build trust with your own email address. Reach visitors with your own
website.

Buy a domain

Get custom email

Create a website

Windows CMD commands: an overview


There are almost 300 commands for Windows and its predecessor, MS-DOS. Over the decades, some
commands have been kept around, some have only recently been added with newer versions of Windows,
and others have been removed or replaced. In our comprehensive list, we explain what the different
commands mean and on which Windows versions they run. This way, you can quickly look up whether the
CMD commands that you know still function with Windows 10. To make it more clear, we’ve divided the
Windows command prompt commands into four categories: basics, files, system, and network.

 Note
The information on the functionality of various Windows versions should only be understood as
orientation information. For the individual commands, it’s not only which Windows version you’re using
that’s important, but also which edition (Home, Pro, Server). In some cases, you have to adjust certain
settings beforehand so that the commands are effective. You also will need access rights as an
administrator for some CMD commands.
Basics

CMD
command Description Windows version  

bitsadmin Creates and monitors downloads and uploads. 10/8/7/Vista  

break Interrupts Ctrl + C checking in DOS, allowing you to stop All Win/DOS  
processes in the old operating system. Only available for
compatibility reasons in Windows.
CMD
command Description Windows version  

call Calls a batch file within another batch file. The command All Win/DOS  
has no effect if entered directly into CMD instead of in a
batch file.

cd Displays the current directory and lets you switch to other All Win/DOS  
directories. With the parameter /D plus drive and path
specification, you can also switch drives. Use cd.. to
switch to a higher directory (has the same function as the
chdir command).

chcp Changes the current code page (character set table) or All Win/DOS  
shows the page count of the current code page.

chdir Displays the current directory and lets you switch to other All Win/DOS  
directories. With the parameter /D plus drive and path
specification, you can also switch drives. Use chdir.. to
switch to a higher directory (has the same function as the
cd command).

choice Creates a selection list: typical example is the selection of All Win (not XP)/DOS  
yes (Y) or no (N), which is created with /C YN. With the
parameter /M you can add an explanatory message for
the user.

clip Forwards the result of a command to the clipboard. For clip) or the content of 10/8/7/Vist
example, you can copy the directory structure (dir a file (clip < filename)
to the clipboard.

cls Clears the content of the screen. All Win/DOS  

cmd Starts CMD.EXE. 10/8/7/Vista/XP  

color Changes the background (first value) and text color 10/8/7/Vista/XP  
(second value) of the command prompt. The color lies
between 0 (black) and F (white).

command Starts CMD.COM. 32-bit/DOS  

date Displays the current date and allows you to change it. All Win/DOS  
With the parameter /T the date is shown without the option
to change.

debug Starts debug, a program that can test and modify 32-bit/DOS  
CMD
command Description Windows version  

programs within the command prompt.

dir Displays all folders and files within the current directory. All Win/DOS  
You can restrict the output by attributes (/A), simplify the
list (/B), or display all subdirectories and their files (/S).

doskey Creates macros, recalls commands, and edits command All Win/DOS  
input.

dosshell Opens the DOS shell, a graphical file management tool. In 95/DOS  
Windows, the DOS shell is replaced by Windows Explorer.

echo Displays a message and is mainly used within scripts and All Win/DOS  
batch files.

edit Starts the MS-DOS editor, with which you can create text 32-bit/DOS  
files.

edlin Creates and edits text files within the command prompt. 32-bit/DOS  

exit Ends CMD.EXE or CMD.COM. All Win/DOS  

fasthelp Displays helpful information about commands. DOS  

fastopen Writes the position of a program into a specified list, which 32-bit/DOS  
is in the working memory and should accelerate the start
of programs.

find Searches through a file or multiple files for a particular All Win/DOS  
character sequence. If you only want to know how
frequently the word or phrase occurs, use the /C
parameter. With the extension /I the command ignores
upper- and lower-case in the search.

findstr Finds character sequences in one or multiple files. It gives 10/8/7/Vista/XP  


you more options when compared to the find command:
you can search for files that contain various terms or
with /C search for an exact word order.

forcedos Starts a program in the MS-DOS partial system, in case XP (32-bit)  


it’s not directly recognized by Windows XP as a DOS
program.
CMD
command Description Windows version  

graftabl Enables the option to use extended characters of a 32-bit/DOS  


specific code page in graphics mode.

graphics Starts a program that can print graphics. 32-bit/DOS  

help Displays help text for a specific command (you can also All Win/DOS  
use the /? command).

kb16 Changes the country settings of the keyboard for DOS 32-bit  
programs (only included in Windows for compatibility
reasons. Replaces the old command keyb).

keyb Changes the country settings of the keyboard for DOS 98/95/DOS  
programs (only included in Windows for compatibility
reasons. Replaced by kb16 in newer Windows versions).

logoff Logs the user out of Windows. Also allows you to end 10/8/7/Vista/XP  
sessions on servers.

lpq Displays the status of a printer queue for computers that All Win  
use a “line Printer Daemon” (LPD). (To use the command
in Windows 10, 8, 7, or Vista, the LPD print service and
the LPR port monitor have to be enabled first).

lpr Sends a file to a computer that uses a line printer daemon All Win  
(LPD). To use the command in Windows 10, 8, 7, or Vista,
the LPD print service and LPR port monitor have to be
enabled first.

md Creates a new directory on the specified path. If All Win/DOS  


directories don’t already exist on the path, md creates
them automatically (you can also use the mkdir
command).

mkdir Creates a new directory on the specified path. If All Win/DOS  


directories don’t already exist on the path, mkdir creates
them automatically (you can also use the md command).

more Outputs the content of a file (for example, a text file) by All Win/DOS  
the page. You can also use the command to split the
output of another command into pages.

msg Sends a message to another user. You can write the 10/8/7/Vista/XP  
CMD
command Description Windows version  

username into the command or create files in which


usernames are saved. The files can then be included in
the command with @filename.

nlsfunc Provides country-specific information for language 32-bit/DOS  


support.

ntbackup Runs backup services directly from the command line or XP  


as part of batch or script files.

path Creates and displays the path for searching executable All Win/DOS  
files.

pause Pauses execution in batch files and scripts. The user is All Win/DOS  
then prompted in a message to continue by pressing a
key.

popd Changes to the folder saved by the pushd command. The 10/8/7/Vista  
command is mainly part of batch files and scripts.

print Prints a text file. The device to be used for printing has to All Win/DOS  
be specified.

prompt Changes the display of the command prompt. All Win/DOS  

pushd Saves a specific path into a script or batch file. You can 10/8/7/Vista/XP  
change to this directory with popd.

qbasic Starts qbasic, a program environment based on the 98/95/DOS  


BASIC programming language.

rd Deletes a directory. This must not contain any files, even All Win/DOS  
hidden ones. You can delete an entire directory tree with
the /S parameter (you can also use the rmdir command).

rem Writes comments in batch and script files that aren’t taken All Win/DOS  
into account when executing.

rmdir Deletes a directory. This must not contain any files, even All Win/DOS  
hidden ones. You can delete an entire directory tree with
the /S parameter (you can also use the rd command).
CMD
command Description Windows version  

runas Allows a user to run commands with the rights of another 10/8/7/Vista/XP  
user. For example, you can run a command as an
administrator from a normal user account as long as you
know the password.

scandisk Starts Microsoft ScanDisk. The program searches data 98/95/DOS  


carriers for errors.

schtasks Sets the execution of specified programs and commands 10/8/7/Vista/XP  


for a specified point in time. You can create, delete,
change, and display all scheduled tasks.

set Displays environmental variables of CMD.EXE and lets All Win/DOS  


you configure them.

shift Moves variables within batch files and scripts. All Win/DOS  

shutdown Shuts down the computer (/s), triggers a restart (/r), or 10/8/7/Vista/XP  
logs the user out (/l). A graphical user interface is
displayed if you enter the parameter /I as the first option in
the command.

sort Lists out data (from a file or command) and outputs it All Win/DOS  
again sorted – directly in the command prompt, in a new
file, or in another output.

start Opens a new command prompt window in which you can All Win  
run a specific program or command.

subst Assigns a drive letter to a path to create a virtual drive. All Win/DOS  

taskkill Ends one or more running tasks. You either have to 10/8/7/Vista  
specify the process ID (PID) or image name.

tasklist Lists all running processes – also on remote computers, if 10/8/7/Vista/XP  


desired. The process ID also has to be specified, which is
required for the taskkill command, for example.

time Displays the current time and allows it to be changed. If All Win/DOS  
the parameter /T is entered, the command prompt only
shows the time and offers no option to directly change it.

timeout Stops a process for a specified time. The command Is 10/8/7/Vista  


CMD
command Description Windows version  

used in batch files and scripts. If you use the /NOBREAK


parameter, the command ignores any keyboard input.

title Changes the title of the command prompt. Spaces are All Win/DOS  
allowed, but not all special characters such as a slash, for
example, because they may be interpreted as instructions
for a parameter.

tree Graphically displays the directory structure of a drive or All Win/DOS  


path. With the /F parameter, all files in the folders are also
listed out. /A also ensures that only ASCII characters are
used for the graphical representation. The command takes
into account all subdirectories starting from the given path.
If you don’t enter a path, the current folder is used as the
output.

type Displays the content of a text file. All Win/DOS  

tzutil Displays the currently set time zone (/g) or changes it (/s). 10/8/7  
The parameter /l helps determine the valid time zones.

ver Displays the current version number of Windows or MS- All Win/DOS  
DOS.

Files

CMD
command Description Windows version

append Sets the path in which files will be searched for. 32-bit/DOS

assoc Changes the program that’s linked with a particular file ending. 10/8/7/Vista/XP

attrib Changes attributes of specified files. With the parameter +R you can All Win/DOS
protect a file from changes.

cipher Displays and changes the encryption status of files and directories on 10/8/7/Vista/XP
NTFS partitions.

comp Compares the content of two files or two file sets. The results can be 10/8/7/Vista/XP
displayed as a decimal value (/D) or with ASCII characters (/A).
CMD
command Description Windows version

compact Displays and changes the compression status of files and directories on 10/8/7/Vista/XP
NTFS partitions.

copy Copies a file or multiple files to another location. It’s also possible to All Win/DOS
connect several files to one. You can use the asterisk as a wild card.

cscript Runs scripts over the Microsoft Script Host. You can enable additional All Win/DOS
debugging with the /D option.

del Deletes a file or multiple files. If you also want to delete all files from All Win/DOS
subfolders, you can do this with the /S parameter. Read-only files can be
deleted with /F (you can also use the erase command).

deltree Deletes a directory as well as all subdirectories and files within. 98/95/DOS

diantz Compresses files without any loss (command has the same function as 7/Vista/XP
makecab).

diskcomp Compares the content of two disks. All Win (not


10)/DOS

diskcopy Copies the content of a disk to another. All Win (not


10)/DOS

endlocal Ends the valid range of changes to batch files or scripts. After the 10/8/7/Vista/XP
command, changes are applied to the entire system again (localization is
started with setlocal).

erase Function is the same as del. All Win/DOS

exe2bin Converts an EXE file to a BIN file. 32-bit

expand Extracts files and folders stored in CAB files. All Win (not 64-bit
XP)/DOS

extrac32 Extracts files and folders stored in CAB files. The program is part of All Win
Internet Explorer, but can also be used in the command prompt.

extract
ave to tediously test which are still valid and which are outdated. Our overview tables describe the
functions of the individual commands and specify under which Microsoft operating systems they’re
effective.

Contents
1. How does a command line work?
2. How do you open the command prompt?
3. How do you enter commands in the command prompt?
4. Windows CMD commands: an overview

How does a command line work?


The command line (also called the console or terminal) is a text-based interface within the operating
system, that forwards commands from the user to the operating system. This makes it possible, for
example, to organize files, start programs, or run other commands linked to the operating system,
computer, or network.

In older operating systems (like MS-DOS), you had to work without a graphical user interface, and
oftentimes even navigate without a mouse. Instead, you had to type in all commands – the directory
structures were then displayed as plain text on the screen. But even after the switch to graphical operating
systems, the command line remained text-based.

In general, the connection between operating system – regardless of whether graphical (GUI = graphical
user interface) or text-based (CLI = command line interpreter) was condensed under the term “Shell.” The
default command line interpreter for Windows is called CMD.EXE. In addition, however, there’s also the
“PowerShell”: This offers more options than CMD.EXE. For example, automations can be created better
with PowerShell. In this way, users can create script programs with the PowerShell scripting language.

 Note
Many Windows console commands are based on batch files. This are usually text files (with the ending
.bat or .cmd) that are run by the command line as batch processing. These files are generally created to
perform routine work and start other programs.

$1 Domain Names
Register great TLDs for less than $1 for the first year.

Why wait? Grab your favorite domain name today!

Matching email
SSL certificate

24/7/365 support
Save Now

How do you open the command prompt?


There are various options for accessing the command line in Windows. Technically speaking, the
command line is the CMD.EXE program. This executable file should be found in the system directory of
your Windows folder. (If you right-click on the file, Windows also gives you the option to start the
program as an administrator – in case you have the access data for this.) To reach the program more
quickly, you can use the search bar or the run menu. The latter is opened under Windows 7, 8, and 10 with
the key combination Win + R. Then all you have to do is type “cmd” into the search field and press the OK
button.

The command prompt has long had a fixed spot in the Windows start menu as well. Under Windows 7
and Windows 10, the program is found in the “System Tools” folder. With Windows 8, Microsoft replaced
the start menu with a start screen. But the command prompt is also found via the apps here. Alternatively,
Windows 8 as well as Windows 10 both offer the “Power User Tasks Menu.” You can open this with the
key combination Win + X. In this way, you can find the command prompt in the normal execution as well
as the administrator version.

How do you enter commands in the command prompt?


CMD functions via defined commands. These have to be entered correctly, otherwise the command
prompt can’t run the task. The same goes for parameters that you link to the commands. Individual
commands can be extended using options (such as arguments). These are generally given as a letter with a
minus sign (-), plus sign (+), or slash (/). CMD also allows placeholders. For so-called wild cards, use an
asterisk (*) or question mark (?). While the latter replaces a single character (i.e. letter, digit, or other
character), the asterisk stands for any number of characters.

 Note
In the command prompt and commands, you also frequently have to work with path specifications. You
need these to navigate through your directories or specify exact positions in commands. For the input of a
path, use the backslash (\).
Individual CMD commands can be combined with one another. Through a pipe, the output of the first
command is interpreted as input for the following command. In the command prompt, commands are
linked to one another with a vertical line (|). This line itself is called a pipe, but officially is known as a
vertical bar. Vertical bars pass data from one command to the next:

 CommandA | CommandB

There’s also the possibility of redirection: where the output of a command is directly forwarded to a file
(>) or the content of a text file is understood as input for the command (<).

 Command > File (output in file)


 Command < File (input from file)

Finally, Windows command line commands can also be connected in such a way that they run directly
after one other. This can be controlled via a relatively simple form (&), but also via two more complex
variations. It’s also possible to only run the second command if the first was successful. Or, you can set up
the exact opposite as well: The second command is only run if the first doesn’t work (||). Both options can
even be combined so that there’s an either-or string of commands:

 CommandA & CommandB (the second command is run directly after the first)
 CommandA && CommandB (the second command is only run if the first was
successful)
 Command A || CommandB (the second command is only run if the first was not
successful)
 CommandA && CommandB || CommandC (the second command is only run if the
first was successful, otherwise the third command is run)

 Tip
Each command has its own syntax and individual options. So that you don’t have to memorize all of these,
CMD offers a help command: Using help command or command /? you can obtain information about how
to handle the command.
It’s also extremely helpful that the command prompt remembers your last entered CMD commands. Using
the up and down arrow keys on the keyboard, you can recall your earlier entries. This also means,
though, that you can’t use these keys to scroll through the CMD window. This is usually done with the
mouse instead. But if you prefer to scroll using keys and are ready to give up the recall command function,
you can alter the corresponding setting: right-click on the command prompt and enable the “Scrolling”
option.

Command, file names or path specifications, as well as arguments, are separated from one another using
spaces. It also usually doesn’t matter if you use upper- or lower-case letters. It’s only important in a few
cases whether you write the parameter in upper- or lower-case (generally only when two different
parameters are abbreviated with the same letter, and are only differentiated from one another through the
case).

3 ways to be present and grow online


Get found with your own domain. Build trust with your own email address. Reach visitors with your own
website.
Buy a domain

Get custom email

Create a website

Windows CMD commands: an overview


There are almost 300 commands for Windows and its predecessor, MS-DOS. Over the decades, some
commands have been kept around, some have only recently been added with newer versions of Windows,
and others have been removed or replaced. In our comprehensive list, we explain what the different
commands mean and on which Windows versions they run. This way, you can quickly look up whether the
CMD commands that you know still function with Windows 10. To make it more clear, we’ve divided the
Windows command prompt commands into four categories: basics, files, system, and network.

 Note
The information on the functionality of various Windows versions should only be understood as
orientation information. For the individual commands, it’s not only which Windows version you’re using
that’s important, but also which edition (Home, Pro, Server). In some cases, you have to adjust certain
settings beforehand so that the commands are effective. You also will need access rights as an
administrator for some CMD commands.

Basics

CMD
command Description Windows version  

bitsadmin Creates and monitors downloads and uploads. 10/8/7/Vista  

break Interrupts Ctrl + C checking in DOS, allowing you All Win/DOS  


to stop processes in the old operating system.
Only available for compatibility reasons in
Windows.

call Calls a batch file within another batch file. The All Win/DOS  
command has no effect if entered directly into
CMD instead of in a batch file.

cd Displays the current directory and lets you switch All Win/DOS  
to other directories. With the parameter /D plus
drive and path specification, you can also switch
drives. Use cd.. to switch to a higher directory (has
the same function as the chdir command).
CMD
command Description Windows version  

chcp Changes the current code page (character set All Win/DOS  
table) or shows the page count of the current code
page.

chdir Displays the current directory and lets you switch All Win/DOS  
to other directories. With the parameter /D plus
drive and path specification, you can also switch
drives. Use chdir.. to switch to a higher directory
(has the same function as the cd command).

choice Creates a selection list: typical example is the All Win (not  
selection of yes (Y) or no (N), which is created XP)/DOS
with /C YN. With the parameter /M you can add an
explanatory message for the user.

clip Forwards the result of a command to the clip) or the content of 10/8/7/Vist
clipboard. For example, you can copy the directory a file (clip <
structure (dir filename) to the
clipboard.

cls Clears the content of the screen. All Win/DOS  

cmd Starts CMD.EXE. 10/8/7/Vista/XP  

color Changes the background (first value) and text 10/8/7/Vista/XP  


color (second value) of the command prompt. The
color lies between 0 (black) and F (white).

command Starts CMD.COM. 32-bit/DOS  

date Displays the current date and allows you to All Win/DOS  
change it. With the parameter /T the date is shown
without the option to change.

debug Starts debug, a program that can test and modify 32-bit/DOS  
programs within the command prompt.

dir Displays all folders and files within the current All Win/DOS  
directory. You can restrict the output by attributes
(/A), simplify the list (/B), or display all
subdirectories and their files (/S).
CMD
command Description Windows version  

doskey Creates macros, recalls commands, and edits All Win/DOS  


command input.

dosshell Opens the DOS shell, a graphical file 95/DOS  


management tool. In Windows, the DOS shell is
replaced by Windows Explorer.

echo Displays a message and is mainly used within All Win/DOS  


scripts and batch files.

edit Starts the MS-DOS editor, with which you can 32-bit/DOS  
create text files.

edlin Creates and edits text files within the command 32-bit/DOS  
prompt.

exit Ends CMD.EXE or CMD.COM. All Win/DOS  

fasthelp Displays helpful information about commands. DOS  

fastopen Writes the position of a program into a specified 32-bit/DOS  


list, which is in the working memory and should
accelerate the start of programs.

find Searches through a file or multiple files for a All Win/DOS  


particular character sequence. If you only want to
know how frequently the word or phrase occurs,
use the /C parameter. With the extension /I the
command ignores upper- and lower-case in the
search.

findstr Finds character sequences in one or multiple files. 10/8/7/Vista/XP  


It gives you more options when compared to the
find command: you can search for files that
contain various terms or with /C search for an
exact word order.

forcedos Starts a program in the MS-DOS partial system, in XP (32-bit)  


case it’s not directly recognized by Windows XP
as a DOS program.

graftabl Enables the option to use extended characters of 32-bit/DOS  


CMD
command Description Windows version  

a specific code page in graphics mode.

graphics Starts a program that can print graphics. 32-bit/DOS  

help Displays help text for a specific command (you All Win/DOS  
can also use the /? command).

kb16 Changes the country settings of the keyboard for 32-bit  


DOS programs (only included in Windows for
compatibility reasons. Replaces the old command
keyb).

keyb Changes the country settings of the keyboard for 98/95/DOS  


DOS programs (only included in Windows for
compatibility reasons. Replaced by kb16 in newer
Windows versions).

logoff Logs the user out of Windows. Also allows you to 10/8/7/Vista/XP  
end sessions on servers.

lpq Displays the status of a printer queue for All Win  


computers that use a “line Printer Daemon” (LPD).
(To use the command in Windows 10, 8, 7, or
Vista, the LPD print service and the LPR port
monitor have to be enabled first).

lpr Sends a file to a computer that uses a line printer All Win  
daemon (LPD). To use the command in Windows
10, 8, 7, or Vista, the LPD print service and LPR
port monitor have to be enabled first.

md Creates a new directory on the specified path. If All Win/DOS  


directories don’t already exist on the path, md
creates them automatically (you can also use the
mkdir command).

mkdir Creates a new directory on the specified path. If All Win/DOS  


directories don’t already exist on the path, mkdir
creates them automatically (you can also use the
md command).

more Outputs the content of a file (for example, a text All Win/DOS  
CMD
command Description Windows version  

file) by the page. You can also use the command


to split the output of another command into pages.

msg Sends a message to another user. You can write 10/8/7/Vista/XP  


the username into the command or create files in
which usernames are saved. The files can then be
included in the command with @filename.

nlsfunc Provides country-specific information for language 32-bit/DOS  


support.

ntbackup Runs backup services directly from the command XP  


line or as part of batch or script files.

path Creates and displays the path for searching All Win/DOS  
executable files.

pause Pauses execution in batch files and scripts. The All Win/DOS  
user is then prompted in a message to continue by
pressing a key.

popd Changes to the folder saved by the pushd 10/8/7/Vista  


command. The command is mainly part of batch
files and scripts.

print Prints a text file. The device to be used for printing All Win/DOS  
has to be specified.

prompt Changes the display of the command prompt. All Win/DOS  

pushd Saves a specific path into a script or batch file. 10/8/7/Vista/XP  


You can change to this directory with popd.

qbasic Starts qbasic, a program environment based on 98/95/DOS  


the BASIC programming language.

rd Deletes a directory. This must not contain any All Win/DOS  


files, even hidden ones. You can delete an entire
directory tree with the /S parameter (you can also
use the rmdir command).
CMD
command Description Windows version  

rem Writes comments in batch and script files that All Win/DOS  
aren’t taken into account when executing.

rmdir Deletes a directory. This must not contain any All Win/DOS  
files, even hidden ones. You can delete an entire
directory tree with the /S parameter (you can also
use the rd command).

runas Allows a user to run commands with the rights of 10/8/7/Vista/XP  


another user. For example, you can run a
command as an administrator from a normal user
account as long as you know the password.

scandisk Starts Microsoft ScanDisk. The program searches 98/95/DOS  


data carriers for errors.

schtasks Sets the execution of specified programs and 10/8/7/Vista/XP  


commands for a specified point in time. You can
create, delete, change, and display all scheduled
tasks.

set Displays environmental variables of CMD.EXE All Win/DOS  


and lets you configure them.

shift Moves variables within batch files and scripts. All Win/DOS  

shutdown Shuts down the computer (/s), triggers a restart 10/8/7/Vista/XP  


(/r), or logs the user out (/l). A graphical user
interface is displayed if you enter the parameter /I
as the first option in the command.

sort Lists out data (from a file or command) and All Win/DOS  
outputs it again sorted – directly in the command
prompt, in a new file, or in another output.

start Opens a new command prompt window in which All Win  


you can run a specific program or command.

subst Assigns a drive letter to a path to create a virtual All Win/DOS  


drive.

taskkill Ends one or more running tasks. You either have 10/8/7/Vista  
CMD
command Description Windows version  

to specify the process ID (PID) or image name.

tasklist Lists all running processes – also on remote 10/8/7/Vista/XP  


computers, if desired. The process ID also has to
be specified, which is required for the taskkill
command, for example.

time Displays the current time and allows it to be All Win/DOS  


changed. If the parameter /T is entered, the
command prompt only shows the time and offers
no option to directly change it.

timeout Stops a process for a specified time. The 10/8/7/Vista  


command Is used in batch files and scripts. If you
use the /NOBREAK parameter, the command
ignores any keyboard input.

title Changes the title of the command prompt. Spaces All Win/DOS  
are allowed, but not all special characters such as
a slash, for example, because they may be
interpreted as instructions for a parameter.

tree Graphically displays the directory structure of a All Win/DOS  


drive or path. With the /F parameter, all files in the
folders are also listed out. /A also ensures that
only ASCII characters are used for the graphical
representation. The command takes into account
all subdirectories starting from the given path. If
you don’t enter a path, the current folder is used
as the output.

type Displays the content of a text file. All Win/DOS  

tzutil Displays the currently set time zone (/g) or 10/8/7  


changes it (/s). The parameter /l helps determine
the valid time zones.

ver Displays the current version number of Windows All Win/DOS  


or MS-DOS.

Files
CMD
comm Windows
and Description version

append Sets the path in which files will be searched for. 32-bit/DOS

assoc Changes the program that’s linked with a particular file ending. 10/8/7/Vist
a/XP

attrib Changes attributes of specified files. With the parameter +R you can protect All
a file from changes. Win/DOS

cipher Displays and changes the encryption status of files and directories on NTFS 10/8/7/Vist
partitions. a/XP

comp Compares the content of two files or two file sets. The results can be 10/8/7/Vist
displayed as a decimal value (/D) or with ASCII characters (/A). a/XP

compact Displays and changes the compression status of files and directories on 10/8/7/Vist
NTFS partitions. a/XP

copy Copies a file or multiple files to another location. It’s also possible to connect All
several files to one. You can use the asterisk as a wild card. Win/DOS

cscript Runs scripts over the Microsoft Script Host. You can enable additional All
debugging with the /D option. Win/DOS

del Deletes a file or multiple files. If you also want to delete all files from All
subfolders, you can do this with the /S parameter. Read-only files can be Win/DOS
deleted with /F (you can also use the erase command).

deltree Deletes a directory as well as all subdirectories and files within. 98/95/DOS

diantz Compresses files without any loss (command has the same function as 7/Vista/XP
makecab).

diskcom Compares the content of two disks. All Win (no


p 10)/DOS

diskcop Copies the content of a disk to another. All Win (no


y 10)/DOS

endlocal Ends the valid range of changes to batch files or scripts. After the command, 10/8/7/Vist
changes are applied to the entire system again (localization is started with
CMD
comm Windows
and Description version

setlocal). a/XP

erase Function is the same as del. All


Win/DOS

exe2bin 32-bit

CMD commands
Converts an EXE file to a BIN file.

for the Windows command prompt


Most IT experts and Linux users, in addition to computer users who work with MS-DOS, are
relatively familiar with the command line and its corresponding commands. But a lot can be
achieved with the command prompt in Windows, too. For this reason, we’ll explain what the
command line is, how to open it, and which CMD commands there are for Windows.

Windows console commands have changed over time: in newer Windows versions, users no
longer have access to some of the familiar commands. In the following, we’ll explain which
CMD commands still work under Windows 10 so that you don’t have to tediously test which are
still valid and which are outdated. Our overview tables describe the functions of the individual
commands and specify under which Microsoft operating systems they’re effective.

Contents
1. How does a command line work?
2. How do you open the command prompt?
3. How do you enter commands in the command prompt?
4. Windows CMD commands: an overview

How does a command line work?


The command line (also called the console or terminal) is a text-based interface within the
operating system, that forwards commands from the user to the operating system. This makes it
possible, for example, to organize files, start programs, or run other commands linked to the
operating system, computer, or network.

In older operating systems (like MS-DOS), you had to work without a graphical user interface,
and oftentimes even navigate without a mouse. Instead, you had to type in all commands – the
directory structures were then displayed as plain text on the screen. But even after the switch to
graphical operating systems, the command line remained text-based.

In general, the connection between operating system – regardless of whether graphical (GUI =
graphical user interface) or text-based (CLI = command line interpreter) was condensed under
the term “Shell.” The default command line interpreter for Windows is called CMD.EXE. In
addition, however, there’s also the “PowerShell”: This offers more options than CMD.EXE. For
example, automations can be created better with PowerShell. In this way, users can create script
programs with the PowerShell scripting language.
CMD
comm Windows
and Description version

 Note
Many Windows console commands are based on batch files. This are usually text files (with the
ending .bat or .cmd) that are run by the command line as batch processing. These files are
generally created to perform routine work and start other programs.

$1 Domain Names
Register great TLDs for less than $1 for the first year.

Why wait? Grab your favorite domain name today!

Matching email

SSL certificate

24/7/365 support
Save Now

How do you open the command prompt?


CMD
comm Windows
and Description version

There are various options for accessing the command line in Windows. Technically speaking,
the command line is the CMD.EXE program. This executable file should be found in the
system directory of your Windows folder. (If you right-click on the file, Windows also gives you
the option to start the program as an administrator – in case you have the access data for this.) To
reach the program more quickly, you can use the search bar or the run menu. The latter is opened
under Windows 7, 8, and 10 with the key combination Win + R. Then all you have to do is type
“cmd” into the search field and press the OK button.

The command prompt has long had a fixed spot in the Windows start menu as well. Under
Windows 7 and Windows 10, the program is found in the “System Tools” folder. With Windows
8, Microsoft replaced the start menu with a start screen. But the command prompt is also found
via the apps here. Alternatively, Windows 8 as well as Windows 10 both offer the “Power User
Tasks Menu.” You can open this with the key combination Win + X. In this way, you can find
the command prompt in the normal execution as well as the administrator version.

How do you enter commands in the command


prompt?
CMD functions via defined commands. These have to be entered correctly, otherwise the
command prompt can’t run the task. The same goes for parameters that you link to the
commands. Individual commands can be extended using options (such as arguments). These are
generally given as a letter with a minus sign (-), plus sign (+), or slash (/). CMD also allows
placeholders. For so-called wild cards, use an asterisk (*) or question mark (?). While the latter
replaces a single character (i.e. letter, digit, or other character), the asterisk stands for any
number of characters.

 Note
In the command prompt and commands, you also frequently have to work with path
specifications. You need these to navigate through your directories or specify exact positions in
commands. For the input of a path, use the backslash (\).
Individual CMD commands can be combined with one another. Through a pipe, the output of
the first command is interpreted as input for the following command. In the command prompt,
commands are linked to one another with a vertical line (|). This line itself is called a pipe, but
officially is known as a vertical bar. Vertical bars pass data from one command to the next:

 CommandA | CommandB

There’s also the possibility of redirection: where the output of a command is directly forwarded
to a file (>) or the content of a text file is understood as input for the command (<).

 Command > File (output in file)


 Command < File (input from file)

Finally, Windows command line commands can also be connected in such a way that they run
directly after one other. This can be controlled via a relatively simple form (&), but also via
two more complex variations. It’s also possible to only run the second command if the first was
successful. Or, you can set up the exact opposite as well: The second command is only run if the
CMD
comm Windows
and Description version

first doesn’t work (||). Both options can even be combined so that there’s an either-or string of
commands:

 CommandA & CommandB (the second command is run directly after the
first)
 CommandA && CommandB (the second command is only run if the first
was successful)
 Command A || CommandB (the second command is only run if the first was
not successful)
 CommandA && CommandB || CommandC (the second command is only run
if the first was successful, otherwise the third command is run)

 Tip
Each command has its own syntax and individual options. So that you don’t have to memorize
all of these, CMD offers a help command: Using help command or command /? you can obtain
information about how to handle the command.
It’s also extremely helpful that the command prompt remembers your last entered CMD
commands. Using the up and down arrow keys on the keyboard, you can recall your earlier
entries. This also means, though, that you can’t use these keys to scroll through the CMD
window. This is usually done with the mouse instead. But if you prefer to scroll using keys and
are ready to give up the recall command function, you can alter the corresponding setting: right-
click on the command prompt and enable the “Scrolling” option.

Command, file names or path specifications, as well as arguments, are separated from one
another using spaces. It also usually doesn’t matter if you use upper- or lower-case letters. It’s
only important in a few cases whether you write the parameter in upper- or lower-case (generally
only when two different parameters are abbreviated with the same letter, and are only
differentiated from one another through the case).

3 ways to be present and grow online


Get found with your own domain. Build trust with your own email address. Reach visitors with
your own website.

Buy a domain

Get custom email


CMD
comm Windows
and Description version

Create a website

Windows CMD commands: an overview


There are almost 300 commands for Windows and its predecessor, MS-DOS. Over the decades,
some commands have been kept around, some have only recently been added with newer
versions of Windows, and others have been removed or replaced. In our comprehensive list, we
explain what the different commands mean and on which Windows versions they run. This way,
you can quickly look up whether the CMD commands that you know still function with
Windows 10. To make it more clear, we’ve divided the Windows command prompt commands
into four categories: basics, files, system, and network.

 Note
The information on the functionality of various Windows versions should only be understood as
orientation information. For the individual commands, it’s not only which Windows version
you’re using that’s important, but also which edition (Home, Pro, Server). In some cases, you
have to adjust certain settings beforehand so that the commands are effective. You also will need
access rights as an administrator for some CMD commands.

Basics

CMD
command Description Windows version

bitsadmin Creates and monitors downloads and uploads. 10/8/7/Vista

break Interrupts Ctrl + C checking in DOS, allowing you All Win/DOS


to stop processes in the old operating system.
Only available for compatibility reasons in
Windows.

call Calls a batch file within another batch file. The All Win/DOS
command has no effect if entered directly into
CMD instead of in a batch file.

cd Displays the current directory and lets you switch All Win/DOS
to other directories. With the parameter /D plus
drive and path specification, you can also switch
drives. Use cd.. to switch to a higher directory (has
the same function as the chdir command).

chcp Changes the current code page (character set All Win/DOS
CMD
comm Windows
and Description version

table) or shows the page count of the current code


page.

chdir Displays the current directory and lets you switch All Win/DOS
to other directories. With the parameter /D plus
drive and path specification, you can also switch
drives. Use chdir.. to switch to a higher directory
(has the same function as the cd command).

choice Creates a selection list: typical example is the All Win (not
selection of yes (Y) or no (N), which is created XP)/DOS
with /C YN. With the parameter /M you can add an
explanatory message for the user.

clip Forwards the result of a command to the clip) or the content of


clipboard. For example, you can copy the directory a file (clip <
structure (dir filename) to the
clipboard.

cls Clears the content of the screen. All Win/DOS

cmd Starts CMD.EXE. 10/8/7/Vista/XP

color Changes the background (first value) and text 10/8/7/Vista/XP


color (second value) of the command prompt. The
color lies between 0 (black) and F (white).

command Starts CMD.COM. 32-bit/DOS

date Displays the current date and allows you to All Win/DOS
change it. With the parameter /T the date is shown
without the option to change.

debug Starts debug, a program that can test and modify 32-bit/DOS
programs within the command prompt.

dir Displays all folders and files within the current All Win/DOS
directory. You can restrict the output by attributes
(/A), simplify the list (/B), or display all
subdirectories and their files (/S).
CMD
comm Windows
and Description version

doskey Creates macros, recalls commands, and edits All Win/DOS


command input.

dosshell Opens the DOS shell, a graphical file 95/DOS


management tool. In Windows, the DOS shell is
replaced by Windows Explorer.

echo Displays a message and is mainly used within All Win/DOS


scripts and batch files.

edit Starts the MS-DOS editor, with which you can 32-bit/DOS
create text files.

edlin Creates and edits text files within the command 32-bit/DOS
prompt.

exit Ends CMD.EXE or CMD.COM. All Win/DOS

fasthelp Displays helpful information about commands. DOS

fastopen Writes the position of a program into a specified 32-bit/DOS


list, which is in the working memory and should
accelerate the start of programs.

find Searches through a file or multiple files for a All Win/DOS


particular character sequence. If you only want to
know how frequently the word or phrase occurs,
use the /C parameter. With the extension /I the
command ignores upper- and lower-case in the
search.

findstr Finds character sequences in one or multiple files. 10/8/7/Vista/XP


It gives you more options when compared to the
find command: you can search for files that
contain various terms or with /C search for an
exact word order.

forcedos Starts a program in the MS-DOS partial system, in XP (32-bit)


case it’s not directly recognized by Windows XP
as a DOS program.
CMD
comm Windows
and Description version

graftabl Enables the option to use extended characters of 32-bit/DOS


a specific code page in graphics mode.

graphics Starts a program that can print graphics. 32-bit/DOS

help Displays help text for a specific command (you All Win/DOS
can also use the /? command).

kb16 Changes the country settings of the keyboard for 32-bit


DOS programs (only included in Windows for
compatibility reasons. Replaces the old command
keyb).

keyb Changes the country settings of the keyboard for 98/95/DOS


DOS programs (only included in Windows for
compatibility reasons. Replaced by kb16 in newer
Windows versions).

logoff Logs the user out of Windows. Also allows you to 10/8/7/Vista/XP
end sessions on servers.

lpq Displays the status of a printer queue for All Win


computers that use a “line Printer Daemon” (LPD).
(To use the command in Windows 10, 8, 7, or
Vista, the LPD print service and the LPR port
monitor have to be enabled first).

lpr Sends a file to a computer that uses a line printer All Win
daemon (LPD). To use the command in Windows
10, 8, 7, or Vista, the LPD print service and LPR
port monitor have to be enabled first.

md Creates a new directory on the specified path. If All Win/DOS


directories don’t already exist on the path, md
creates them automatically (you can also use the
mkdir command).

mkdir Creates a new directory on the specified path. If All Win/DOS


directories don’t already exist on the path, mkdir
creates them automatically (you can also use the
CMD
comm Windows
and Description version

md command).

more Outputs the content of a file (for example, a text All Win/DOS
file) by the page. You can also use the command
to split the output of another command into pages.

msg Sends a message to another user. You can write 10/8/7/Vista/XP


the username into the command or create files in
which usernames are saved. The files can then be
included in the command with @filename.

nlsfunc Provides country-specific information for language 32-bit/DOS


support.

ntbackup Runs backup services directly from the command XP


line or as part of batch or script files.

path Creates and displays the path for searching All Win/DOS
executable files.

pause Pauses execution in batch files and scripts. The All Win/DOS
user is then prompted in a message to continue by
pressing a key.

popd Changes to the folder saved by the pushd 10/8/7/Vista


command. The command is mainly part of batch
files and scripts.

print Prints a text file. The device to be used for printing All Win/DOS
has to be specified.

prompt Changes the display of the command prompt. All Win/DOS

pushd Saves a specific path into a script or batch file. 10/8/7/Vista/XP


You can change to this directory with popd.

qbasic Starts qbasic, a program environment based on 98/95/DOS


the BASIC programming language.

rd Deletes a directory. This must not contain any All Win/DOS


CMD
comm Windows
and Description version

files, even hidden ones. You can delete an entire


directory tree with the /S parameter (you can also
use the rmdir command).

rem Writes comments in batch and script files that All Win/DOS
aren’t taken into account when executing.

rmdir Deletes a directory. This must not contain any All Win/DOS
files, even hidden ones. You can delete an entire
directory tree with the /S parameter (you can also
use the rd command).

runas Allows a user to run commands with the rights of 10/8/7/Vista/XP


another user. For example, you can run a
command as an administrator from a normal user
account as long as you know the password.

scandisk Starts Microsoft ScanDisk. The program searches 98/95/DOS


data carriers for errors.

schtasks Sets the execution of specified programs and 10/8/7/Vista/XP


commands for a specified point in time. You can
create, delete, change, and display all scheduled
tasks.

set Displays environmental variables of CMD.EXE All Win/DOS


and lets you configure them.

shift Moves variables within batch files and scripts. All Win/DOS

shutdown Shuts down the computer (/s), triggers a restart 10/8/7/Vista/XP


(/r), or logs the user out (/l). A graphical user
interface is displayed if you enter the parameter /I
as the first option in the command.

sort Lists out data (from a file or command) and All Win/DOS
outputs it again sorted – directly in the command
prompt, in a new file, or in another output.

start Opens a new command prompt window in which All Win


you can run a specific program or command.
CMD
comm Windows
and Description version

subst Assigns a drive letter to a path to create a virtual All Win/DOS


drive.

taskkill Ends one or more running tasks. You either have 10/8/7/Vista
to specify the process ID (PID) or image name.

tasklist Lists all running processes – also on remote 10/8/7/Vista/XP


computers, if desired. The process ID also has to
be specified, which is required for the taskkill
command, for example.

time Displays the current time and allows it to be All Win/DOS


changed. If the parameter /T is entered, the
command prompt only shows the time and offers
no option to directly change it.

timeout Stops a process for a specified time. The 10/8/7/Vista


command Is used in batch files and scripts. If you
use the /NOBREAK parameter, the command
ignores any keyboard input.

title Changes the title of the command prompt. Spaces All Win/DOS
are allowed, but not all special characters such as
a slash, for example, because they may be
interpreted as instructions for a parameter.

tree Graphically displays the directory structure of a All Win/DOS


drive or path. With the /F parameter, all files in the
folders are also listed out. /A also ensures that
only ASCII characters are used for the graphical
representation. The command takes into account
all subdirectories starting from the given path. If
you don’t enter a path, the current folder is used
as the output.

type Displays the content of a text file. All Win/DOS

tzutil Displays the currently set time zone (/g) or 10/8/7


changes it (/s). The parameter /l helps determine
the valid time zones.
CMD
comm Windows
and Description version

ver Displays the current version number of Windows All Win/DOS


or MS-DOS.

Files

CMD
command Description

append Sets the path in which files will be searched for.

assoc Changes the program that’s linked with a particular file ending.

attrib Changes attributes of specified files. With the parameter +R you


can protect a file from changes.

cipher Displays and changes the encryption status of files and


directories on NTFS partitions.

comp Compares the content of two files or two file sets. The results
can be displayed as a decimal value (/D) or with ASCII
characters (/A).

compact Displays and changes the compression status of files and


directories on NTFS partitions.

copy Copies a file or multiple files to another location. It’s also


possible to connect several files to one. You can use the asterisk
as a wild card.

cscript Runs scripts over the Microsoft Script Host. You can enable
additional debugging with the /D option.

del Deletes a file or multiple files. If you also want to delete all files
from subfolders, you can do this with the /S parameter. Read-
only files can be deleted with /F (you can also use the erase
command).

deltree Deletes a directory as well as all subdirectories and files within.


CMD
comm Windows
and Description version

CMD
command Description

diantz Compresses files without any loss (command has the same
function as makecab).

diskcomp Compares the content of two disks.

diskcopy Copies the content of a disk to another.

endlocal Ends the valid range of changes to batch files or scripts. After
the command, changes are applied to the entire system again
(localization is started with setlocal).

erase Function is the same as del.

exe2bin Converts an EXE file to a BIN file.

expand Extracts files and folders stored in CAB files.

extrac32 Extracts files and folders stored in CAB files. The program is part
of Internet Explorer, but can also be used in the command
prompt.

extract

CMD commands for the Windows


command prompt
Most IT experts and Linux users, in addition to computer users who work with MS-DOS, are
relatively familiar with the command line and its corresponding commands. But a lot can be
achieved with the command prompt in Windows, too. For this reason, we’ll explain what the
command line is, how to open it, and which CMD commands there are for Windows.
CMD
comm Windows
and Description version

Windows console commands have changed over time: in newer Windows versions, users no
longer have access to some of the familiar commands. In the following, we’ll explain which
CMD commands still work under Windows 10 so that you don’t have to tediously test which are
still valid and which are outdated. Our overview tables describe the functions of the individual
commands and specify under which Microsoft operating systems they’re effective.

Contents
1. How does a command line work?
2. How do you open the command prompt?
3. How do you enter commands in the command prompt?
4. Windows CMD commands: an overview

How does a command line work?


The command line (also called the console or terminal) is a text-based interface within the
operating system, that forwards commands from the user to the operating system. This makes it
possible, for example, to organize files, start programs, or run other commands linked to the
operating system, computer, or network.

In older operating systems (like MS-DOS), you had to work without a graphical user interface,
and oftentimes even navigate without a mouse. Instead, you had to type in all commands – the
directory structures were then displayed as plain text on the screen. But even after the switch to
graphical operating systems, the command line remained text-based.

In general, the connection between operating system – regardless of whether graphical (GUI =
graphical user interface) or text-based (CLI = command line interpreter) was condensed under
the term “Shell.” The default command line interpreter for Windows is called CMD.EXE. In
addition, however, there’s also the “PowerShell”: This offers more options than CMD.EXE. For
example, automations can be created better with PowerShell. In this way, users can create script
programs with the PowerShell scripting language.

 Note
Many Windows console commands are based on batch files. This are usually text files (with the
ending .bat or .cmd) that are run by the command line as batch processing. These files are
generally created to perform routine work and start other programs.

$1 Domain Names
Register great TLDs for less than $1 for the first year.

Why wait? Grab your favorite domain name today!


CMD
comm Windows
and Description version

Matching email

SSL certificate

24/7/365 support
Save Now

How do you open the command prompt?


There are various options for accessing the command line in Windows. Technically speaking,
the command line is the CMD.EXE program. This executable file should be found in the
system directory of your Windows folder. (If you right-click on the file, Windows also gives you
the option to start the program as an administrator – in case you have the access data for this.) To
reach the program more quickly, you can use the search bar or the run menu. The latter is opened
under Windows 7, 8, and 10 with the key combination Win + R. Then all you have to do is type
“cmd” into the search field and press the OK button.

The command prompt has long had a fixed spot in the Windows start menu as well. Under
Windows 7 and Windows 10, the program is found in the “System Tools” folder. With Windows
8, Microsoft replaced the start menu with a start screen. But the command prompt is also found
via the apps here. Alternatively, Windows 8 as well as Windows 10 both offer the “Power User
Tasks Menu.” You can open this with the key combination Win + X. In this way, you can find
CMD
comm Windows
and Description version

the command prompt in the normal execution as well as the administrator version.

How do you enter commands in the command


prompt?
CMD functions via defined commands. These have to be entered correctly, otherwise the
command prompt can’t run the task. The same goes for parameters that you link to the
commands. Individual commands can be extended using options (such as arguments). These are
generally given as a letter with a minus sign (-), plus sign (+), or slash (/). CMD also allows
placeholders. For so-called wild cards, use an asterisk (*) or question mark (?). While the latter
replaces a single character (i.e. letter, digit, or other character), the asterisk stands for any
number of characters.

 Note
In the command prompt and commands, you also frequently have to work with path
specifications. You need these to navigate through your directories or specify exact positions in
commands. For the input of a path, use the backslash (\).
Individual CMD commands can be combined with one another. Through a pipe, the output of
the first command is interpreted as input for the following command. In the command prompt,
commands are linked to one another with a vertical line (|). This line itself is called a pipe, but
officially is known as a vertical bar. Vertical bars pass data from one command to the next:

 CommandA | CommandB

There’s also the possibility of redirection: where the output of a command is directly forwarded
to a file (>) or the content of a text file is understood as input for the command (<).

 Command > File (output in file)


 Command < File (input from file)

Finally, Windows command line commands can also be connected in such a way that they run
directly after one other. This can be controlled via a relatively simple form (&), but also via
two more complex variations. It’s also possible to only run the second command if the first was
successful. Or, you can set up the exact opposite as well: The second command is only run if the
first doesn’t work (||). Both options can even be combined so that there’s an either-or string of
commands:

 CommandA & CommandB (the second command is run directly after the
first)
 CommandA && CommandB (the second command is only run if the first
was successful)
 Command A || CommandB (the second command is only run if the first was
not successful)
 CommandA && CommandB || CommandC (the second command is only run
CMD
comm Windows
and Description version

if the first was successful, otherwise the third command is run)

 Tip
Each command has its own syntax and individual options. So that you don’t have to memorize
all of these, CMD offers a help command: Using help command or command /? you can obtain
information about how to handle the command.
It’s also extremely helpful that the command prompt remembers your last entered CMD
commands. Using the up and down arrow keys on the keyboard, you can recall your earlier
entries. This also means, though, that you can’t use these keys to scroll through the CMD
window. This is usually done with the mouse instead. But if you prefer to scroll using keys and
are ready to give up the recall command function, you can alter the corresponding setting: right-
click on the command prompt and enable the “Scrolling” option.

Command, file names or path specifications, as well as arguments, are separated from one
another using spaces. It also usually doesn’t matter if you use upper- or lower-case letters. It’s
only important in a few cases whether you write the parameter in upper- or lower-case (generally
only when two different parameters are abbreviated with the same letter, and are only
differentiated from one another through the case).

3 ways to be present and grow online


Get found with your own domain. Build trust with your own email address. Reach visitors with
your own website.

Buy a domain

Get custom email

Create a website

Windows CMD commands: an overview


There are almost 300 commands for Windows and its predecessor, MS-DOS. Over the decades,
some commands have been kept around, some have only recently been added with newer
versions of Windows, and others have been removed or replaced. In our comprehensive list, we
explain what the different commands mean and on which Windows versions they run. This way,
you can quickly look up whether the CMD commands that you know still function with
Windows 10. To make it more clear, we’ve divided the Windows command prompt commands
into four categories: basics, files, system, and network.
CMD
comm Windows
and Description version

 Note
The information on the functionality of various Windows versions should only be understood as
orientation information. For the individual commands, it’s not only which Windows version
you’re using that’s important, but also which edition (Home, Pro, Server). In some cases, you
have to adjust certain settings beforehand so that the commands are effective. You also will need
access rights as an administrator for some CMD commands.

Basics

CMD
command Description Windows version

bitsadmin Creates and monitors downloads and uploads. 10/8/7/Vista

break Interrupts Ctrl + C checking in DOS, allowing you All Win/DOS


to stop processes in the old operating system.
Only available for compatibility reasons in
Windows.

call Calls a batch file within another batch file. The All Win/DOS
command has no effect if entered directly into
CMD instead of in a batch file.

cd Displays the current directory and lets you switch All Win/DOS
to other directories. With the parameter /D plus
drive and path specification, you can also switch
drives. Use cd.. to switch to a higher directory (has
the same function as the chdir command).

chcp Changes the current code page (character set All Win/DOS
table) or shows the page count of the current code
page.

chdir Displays the current directory and lets you switch All Win/DOS
to other directories. With the parameter /D plus
drive and path specification, you can also switch
drives. Use chdir.. to switch to a higher directory
(has the same function as the cd command).

choice Creates a selection list: typical example is the All Win (not
selection of yes (Y) or no (N), which is created
CMD
comm Windows
and Description version

CMD
command Description Windows version

with /C YN. With the parameter /M you can add an XP)/DOS


explanatory message for the user.

clip Forwards the result of a command to the clip) or the content of


clipboard. For example, you can copy the directory a file (clip <
structure (dir filename) to the
clipboard.

cls Clears the content of the screen. All Win/DOS

cmd Starts CMD.EXE. 10/8/7/Vista/XP

color Changes the background (first value) and text 10/8/7/Vista/XP


color (second value) of the command prompt. The
color lies between 0 (black) and F (white).

command Starts CMD.COM. 32-bit/DOS

date Displays the current date and allows you to All Win/DOS
change it. With the parameter /T the date is shown
without the option to change.

debug Starts debug, a program that can test and modify 32-bit/DOS
programs within the command prompt.

dir Displays all folders and files within the current All Win/DOS
directory. You can restrict the output by attributes
(/A), simplify the list (/B), or display all
subdirectories and their files (/S).

doskey Creates macros, recalls commands, and edits All Win/DOS


command input.

dosshell Opens the DOS shell, a graphical file 95/DOS


management tool. In Windows, the DOS shell is
replaced by Windows Explorer.
CMD
comm Windows
and Description version

CMD
command Description Windows version

echo Displays a message and is mainly used within All Win/DOS


scripts and batch files.

edit Starts the MS-DOS editor, with which you can 32-bit/DOS
create text files.

edlin Creates and edits text files within the command 32-bit/DOS
prompt.

exit Ends CMD.EXE or CMD.COM. All Win/DOS

fasthelp Displays helpful information about commands. DOS

fastopen Writes the position of a program into a specified 32-bit/DOS


list, which is in the working memory and should
accelerate the start of programs.

find Searches through a file or multiple files for a All Win/DOS


particular character sequence. If you only want to
know how frequently the word or phrase occurs,
use the /C parameter. With the extension /I the
command ignores upper- and lower-case in the
search.

findstr Finds character sequences in one or multiple files. 10/8/7/Vista/XP


It gives you more options when compared to the
find command: you can search for files that
contain various terms or with /C search for an
exact word order.

forcedos Starts a program in the MS-DOS partial system, in XP (32-bit)


case it’s not directly recognized by Windows XP
as a DOS program.

graftabl Enables the option to use extended characters of 32-bit/DOS


a specific code page in graphics mode.
CMD
comm Windows
and Description version

CMD
command Description Windows version

graphics Starts a program that can print graphics. 32-bit/DOS

help Displays help text for a specific command (you All Win/DOS
can also use the /? command).

kb16 Changes the country settings of the keyboard for 32-bit


DOS programs (only included in Windows for
compatibility reasons. Replaces the old command
keyb).

keyb Changes the country settings of the keyboard for 98/95/DOS


DOS programs (only included in Windows for
compatibility reasons. Replaced by kb16 in newer
Windows versions).

logoff Logs the user out of Windows. Also allows you to 10/8/7/Vista/XP
end sessions on servers.

lpq Displays the status of a printer queue for All Win


computers that use a “line Printer Daemon” (LPD).
(To use the command in Windows 10, 8, 7, or
Vista, the LPD print service and the LPR port
monitor have to be enabled first).

lpr Sends a file to a computer that uses a line printer All Win
daemon (LPD). To use the command in Windows
10, 8, 7, or Vista, the LPD print service and LPR
port monitor have to be enabled first.

md Creates a new directory on the specified path. If All Win/DOS


directories don’t already exist on the path, md
creates them automatically (you can also use the
mkdir command).

mkdir Creates a new directory on the specified path. If All Win/DOS


directories don’t already exist on the path, mkdir
creates them automatically (you can also use the
CMD
comm Windows
and Description version

CMD
command Description Windows version

md command).

more Outputs the content of a file (for example, a text All Win/DOS
file) by the page. You can also use the command
to split the output of another command into pages.

msg Sends a message to another user. You can write 10/8/7/Vista/XP


the username into the command or create files in
which usernames are saved. The files can then be
included in the command with @filename.

nlsfunc Provides country-specific information for language 32-bit/DOS


support.

ntbackup Runs backup services directly from the command XP


line or as part of batch or script files.

path Creates and displays the path for searching All Win/DOS
executable files.

pause Pauses execution in batch files and scripts. The All Win/DOS
user is then prompted in a message to continue by
pressing a key.

popd Changes to the folder saved by the pushd 10/8/7/Vista


command. The command is mainly part of batch
files and scripts.

print Prints a text file. The device to be used for printing All Win/DOS
has to be specified.

prompt Changes the display of the command prompt. All Win/DOS

pushd Saves a specific path into a script or batch file. 10/8/7/Vista/XP


You can change to this directory with popd.
CMD
comm Windows
and Description version

CMD
command Description Windows version

qbasic Starts qbasic, a program environment based on 98/95/DOS


the BASIC programming language.

rd Deletes a directory. This must not contain any All Win/DOS


files, even hidden ones. You can delete an entire
directory tree with the /S parameter (you can also
use the rmdir command).

rem Writes comments in batch and script files that All Win/DOS
aren’t taken into account when executing.

rmdir Deletes a directory. This must not contain any All Win/DOS
files, even hidden ones. You can delete an entire
directory tree with the /S parameter (you can also
use the rd command).

runas Allows a user to run commands with the rights of 10/8/7/Vista/XP


another user. For example, you can run a
command as an administrator from a normal user
account as long as you know the password.

scandisk Starts Microsoft ScanDisk. The program searches 98/95/DOS


data carriers for errors.

schtasks Sets the execution of specified programs and 10/8/7/Vista/XP


commands for a specified point in time. You can
create, delete, change, and display all scheduled
tasks.

set Displays environmental variables of CMD.EXE All Win/DOS


and lets you configure them.

shift Moves variables within batch files and scripts. All Win/DOS

shutdown Shuts down the computer (/s), triggers a restart 10/8/7/Vista/XP


(/r), or logs the user out (/l). A graphical user
interface is displayed if you enter the parameter /I
CMD
comm Windows
and Description version

CMD
command Description Windows version

as the first option in the command.

sort Lists out data (from a file or command) and All Win/DOS
outputs it again sorted – directly in the command
prompt, in a new file, or in another output.

start Opens a new command prompt window in which All Win


you can run a specific program or command.

subst Assigns a drive letter to a path to create a virtual All Win/DOS


drive.

taskkill Ends one or more running tasks. You either have 10/8/7/Vista
to specify the process ID (PID) or image name.

tasklist Lists all running processes – also on remote 10/8/7/Vista/XP


computers, if desired. The process ID also has to
be specified, which is required for the taskkill
command, for example.

time Displays the current time and allows it to be All Win/DOS


changed. If the parameter /T is entered, the
command prompt only shows the time and offers
no option to directly change it.

timeout Stops a process for a specified time. The 10/8/7/Vista


command Is used in batch files and scripts. If you
use the /NOBREAK parameter, the command
ignores any keyboard input.

title Changes the title of the command prompt. Spaces All Win/DOS
are allowed, but not all special characters such as
a slash, for example, because they may be
interpreted as instructions for a parameter.

tree Graphically displays the directory structure of a All Win/DOS


drive or path. With the /F parameter, all files in the
CMD
comm Windows
and Description version

CMD
command Description Windows version

folders are also listed out. /A also ensures that


only ASCII characters are used for the graphical
representation. The command takes into account
all subdirectories starting from the given path. If
you don’t enter a path, the current folder is used
as the output.

type Displays the content of a text file. All Win/DOS

tzutil Displays the currently set time zone (/g) or 10/8/7


changes it (/s). The parameter /l helps determine
the valid time zones.

ver Displays the current version number of Windows All Win/DOS


or MS-DOS.

Files

CMD
command Description

append Sets the path in which files will be searched for.

assoc Changes the program that’s linked with a particular file ending.

attrib Changes attributes of specified files. With the parameter +R you


can protect a file from changes.

cipher Displays and changes the encryption status of files and


directories on NTFS partitions.

comp Compares the content of two files or two file sets. The results
can be displayed as a decimal value (/D) or with ASCII
characters (/A).
CMD
comm Windows
and Description version

CMD
command Description

compact Displays and changes the compression status of files and


directories on NTFS partitions.

copy Copies a file or multiple files to another location. It’s also


possible to connect several files to one. You can use the asterisk
as a wild card.

cscript Runs scripts over the Microsoft Script Host. You can enable
additional debugging with the /D option.

del Deletes a file or multiple files. If you also want to delete all files
from subfolders, you can do this with the /S parameter. Read-
only files can be deleted with /F (you can also use the erase
command).

deltree Deletes a directory as well as all subdirectories and files within.

diantz Compresses files without any loss (command has the same
function as makecab).

diskcomp Compares the content of two disks.

diskcopy Copies the content of a disk to another.

endlocal Ends the valid range of changes to batch files or scripts. After
the command, changes are applied to the entire system again
(localization is started with setlocal).

erase Function is the same as del.

exe2bin Converts an EXE file to a BIN file.

expand Extracts files and folders stored in CAB files.


CMD
comm Windows
and Description version

CMD
command Description

extrac32 Extracts files and folders stored in CAB files. The program is part
of Internet Explorer, but can also be used in the command
prompt.

extract

expand Extracts files and folders stored in CAB files. All Win (no
64-bit
XP)/DOS

extrac3 Extracts files and folders stored in CAB files. The program is part of Internet All Win
2 Explorer, but can also be used in the command prompt.

extract

You might also like