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. 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. 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. 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.
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 CommandBThere’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 ( File (output in file). 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). 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 commandDescriptionWindows versionbitsadminCreates and monitors downloads and uploads.10/8/7/VistabreakInterrupts Ctrl + C checking in DOS, allowing you to stop processes in the old operating system.
Only available for compatibility reasons in Windows.All Win/DOScallCalls a batch file within another batch file. The command has no effect if entered directly into CMD instead of in a batch file.All Win/DOScdDisplays the current directory and lets you switch to other directories. With the parameter /D plus drive and path specification, you can also switch drives. To switch to a higher directory (has the same function as the chdir command).All Win/DOSchcpChanges the current code page (character set table) or shows the page count of the current code page.All Win/DOSchdirDisplays the current directory and lets you switch to other directories. With the parameter /D plus drive and path specification, you can also switch drives.
To switch to a higher directory (has the same function as the cd command).All Win/DOSchoiceCreates a selection list: typical example is the selection of yes (Y) or no (N), which is created with /C YN. With the parameter /M you can add an explanatory message for the user.All Win (not XP)/DOSclipForwards the result of a command to the clipboard. For example, you can copy the directory structure (dirclip) or the content of a file (clip. CMD commandDescriptionWindows versionappendSets the path in which files will be searched for.32-bit/DOSassocChanges the program that’s linked with a particular file ending.10/8/7/Vista/XPattribChanges attributes of specified files.
With the parameter +R you can protect a file from changes.All Win/DOScipherDisplays and changes the encryption status of files and directories on NTFS partitions.10/8/7/Vista/XPcompCompares the content of two files or two file sets. The results can be displayed as a decimal value (/D) or with ASCII characters (/A).10/8/7/Vista/XPcompactDisplays and changes the compression status of files and directories on NTFS partitions.10/8/7/Vista/XPcopyCopies 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.All Win/DOScscriptRuns scripts over the Microsoft Script Host. You can enable additional debugging with the /D option.All Win/DOSdelDeletes 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).All Win/DOSdeltreeDeletes a directory as well as all subdirectories and files within.98/95/DOSdiantzCompresses files without any loss (command has the same function as makecab).7/Vista/XPdiskcompCompares the content of two disks.All Win (not 10)/DOSdiskcopyCopies the content of a disk to another.All Win (not 10)/DOSendlocalEnds 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).10/8/7/Vista/XPeraseFunction is the same as del.All Win/DOSexe2binConverts an EXE file to a BIN file.32-bitexpandExtracts files and folders stored in CAB files.All Win (not 64-bit XP)/DOSextrac32Extracts files and folders stored in CAB files. The program is part of Internet Explorer, but can also be used in the command prompt.All WinextractExtracts files and folders stored in CAB files (in new Windows versions use expand).98/95fcCompares two individual files or two sets of files with one another and displays the differences.All Win/DOSforSets a specific command that should be run for each individual file in a file set. This command is usually used in batch and script files.All Win/DOSforfilesSelects one or more files and runs a command that refers to these files.
Usually used for batch and script files.10/8/7/VistaftypeSpecifies a program for opening a specific file type.10/8/7/Vista/XPgotoSkips the execution within a batch program to a specific line (marker).All Win/DOSifRepresents a conditional statement and executes expressions within batch files only under certain conditions. Can be extended by not if commands are only not to be executed under certain conditions.All Win/DOSmakecabCompresses files without loss in CAB format (you can also use the diantz command).10/8/7/Vista/XPmklinkCreates a symbolic link to a file.
With /D you can also create connections to directories. Create a fixed connection instead of a symbolic connection with /H.10/8/7/VistamoveMoves a file or multiple files from one directory to another. The command 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.All Win/DOSopenfilesDisplays and separates open system files and folders.10/8/7/Vista/XPrecoverRestores readable files that were on a defective data drive.10/8/7/Vista/XPrenChanges the name of a particular file.
Directory and drive cannot be changed this way (or use the rename command).All Win/DOSrenameFunction is the same as ren.All Win/DOSreplaceReplaces the selected file or files with one or more other files. With /S files 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.All Win/DOSrobocopyAllows so-called robust file copying. This is an extended version of copy 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.10/8/7/VistarsmManages media on removable storage devices. Is used in batch files and scripts to support programs that don’t use “Removable Storage API.”Vista/XPsetlocalLimits the valid range of changes to batch files or scripts. After the command, changes only apply to these files (localization is started with endlocal).10/8/7/Vista/XPshareInstalls file sharing and file locking.32-bit/DOSsxstraceStarts the WinSxs Tracing Utility, a tool for programming diagnostics.10/8/7/VistatakeownRestores administrator access rights to a file that have been lost when reassigning a user.10/8/7/VistaundeleteUndoes the deletion of a file.DOSverifyWhen enabled, checks whether files are written correctly on a data drive.
The check is disabled in the standard settings.All Win/DOSwhereFinds files that match a particular search topic. The placeholders.
and? Can be used within the topic.10/8/7/VistaxcopyCopies files and entire directory structures. In this way, the command 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).All Win/DOS. CMD commandDescriptionWindows versionatStarts commands and programs at a particular time. With the parameter /every:date, you can also set regular appointments.10/8/7/Vista/XPauditpolDisplays current monitoring policies.10/8/7/VistabackupCreates backups of files.