Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is no single universal list of every program that can be run from Command Prompt. Windows includes built-in cmd.exe commands, separate executable utilities, and commands belonging to their own interpreters. To see the system commands available to your shell, run help. This guide provides a practical catalog of commonly documented Windows commands, explains CMD syntax, and clarifies what “complete” means.

What counts as a CMD command?

cmd.exe is the Windows command processor. Some commands are built into it, while others are executable files located in Windows directories or elsewhere in PATH.

Use these commands to investigate what is available on a particular computer:

  • help lists and briefly describes the system commands available to the command shell.
  • where robocopy locates matching executable files in the current directory and directories in PATH.
  • where /r C:\Windows *.exe recursively searches a directory tree for matching executable files.

help is not an inventory of every executable installed on the computer. Third-party tools and programs in PATH may be runnable even if they are not listed by help. Results vary by Windows edition, installed features, system architecture, and software added by administrators.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Practical list of Windows CMD commands

Microsoft’s current command reference covers Windows 10, Windows 11, supported Windows Server releases, and Azure Local. The catalog below includes commonly used commands; some are CMD built-ins and others are standalone utilities. Availability can vary, so check the target computer before relying on an optional command.

Shell, batch-file, and environment commands

Command What it does Typical example
call Calls another batch file or label and returns to the caller. call backup.cmd
cmd Starts a new command processor instance. cmd /c dir
doskey Defines macros and provides command-history features. doskey /history
echo Displays text or turns command echoing on or off. echo %PATH%
endlocal Ends a localized environment-variable section. endlocal
exit Closes the shell or exits a batch file. exit /b 1
for Repeats a command for files, directories, text, command output, or numbers. for %f in (*.log) do echo %f
goto Jumps to a label in a batch file. goto :error
if Runs commands conditionally. if exist report.txt echo Found
path Displays or sets the executable search path. path C:\Tools;%PATH%
pause Suspends a batch file until a key is pressed. pause
prompt Changes the command prompt. prompt $P$G
rem Adds a comment to a batch file. rem Cleanup starts here
set Displays, creates, changes, or deletes environment variables. set BUILD=release
setlocal Localizes environment-variable changes in a batch file. setlocal enabledelayedexpansion
shift Shifts batch-file parameters. shift /1
start Starts a program, document, or separate command window. start “” notepad.exe
timeout Waits for a specified number of seconds. timeout /t 10
title Sets the Command Prompt window title. title Backup job

Files, folders, and text

Command Purpose
attrib Displays or changes file attributes such as read-only, hidden, and system.
cd / chdir Changes or displays the current directory.
cls Clears the Command Prompt window.
comp Compares the contents of two files.
compact Displays or changes NTFS compression for files and directories.
copy Copies one or more files.
del / erase Deletes files.
dir Lists files and directories.
fc Compares files and shows their differences.
find Searches for a text string in files or piped input.
findstr Searches files using strings and regular-expression-style patterns.
ftype Displays or changes commands associated with file extensions.
makecab Creates Cabinet files when the utility is installed and available.
md / mkdir Creates a directory.
mklink Creates symbolic links, hard links, and directory junctions.
more Displays output one screen at a time.
move Moves files or directories.
print Sends a text file to a printer.
rd / rmdir Removes directories.
ren / rename Changes file or directory names.
replace Replaces files in a destination directory.
robocopy Copies files and directory trees with restart, mirroring, logging, and filtering options.
sort Sorts text input.
tree Displays a graphical directory structure.
type Displays the contents of a text file.
xcopy Copies files and directory trees with more options than basic copy.

To inspect a long text file, use type C:\Logs\backup.log | more. Do not use type to inspect an executable or other binary file; the output may contain control characters or escape sequences. In PowerShell, type is an alias for Get-Content, which differs from the CMD built-in.

Disks, volumes, and storage

Command Purpose
chkdsk Checks a volume’s file system and, with the appropriate options, repairs errors.
cipher Manages NTFS encryption and can securely overwrite deleted data.
convert Converts a FAT volume to NTFS.
defrag Analyzes and optimizes volumes.
diskcomp Compares the contents of two floppy disks; a legacy utility.
diskcopy Copies the contents of one floppy disk to another; a legacy utility.
diskpart Starts the DiskPart disk-management interpreter.
format Formats a disk for a specified file system.
fsutil Performs advanced file-system and volume tasks.
label Creates, changes, or deletes a volume label.
mountvol Creates, removes, or lists volume mount points.
recover Attempts to recover readable information from a damaged disk.
subst Associates a drive letter with a directory.
vol Displays a disk’s volume label and serial number.

Important: DiskPart has its own command interpreter. Start diskpart, then type help at the DISKPART> prompt to see commands such as list disk, select disk, list volume, and clean. DiskPart can destroy partitions and data, so verify the selected disk before using destructive commands.

Networking and remote access

Command Purpose
arp Displays and modifies the IPv4 ARP cache.
curl Makes HTTP and other supported network requests from the command line.
ftp Transfers files using FTP.
getmac Displays network adapter MAC addresses.
hostname Displays the computer’s host name.
ipconfig Displays or refreshes IP configuration, DNS, and DHCP information.
nbtstat Displays NetBIOS over TCP/IP statistics and name tables.
net Manages or queries network resources, accounts, shares, services, and sessions through subcommands.
netsh Opens a network-shell utility for firewall, interface, WLAN, and other network configuration.
nslookup Queries DNS servers.
pathping Combines route tracing with packet-loss and latency statistics.
ping Tests reachability and round-trip time using ICMP.
rasdial Connects to or disconnects from a remote-access connection.
route Displays or changes the local IP routing table.
tracert Traces the path to a destination.
whois Queries WHOIS information where the utility is installed or available.

Processes, services, users, and Windows administration

Command Purpose
driverquery Lists installed device drivers.
gpresult Reports the Resultant Set of Policy for a user or computer.
gpupdate Refreshes Group Policy settings.
icacls Displays or modifies NTFS permissions.
openfiles Displays or disconnects open files, when local tracking is enabled.
runas Runs a program under another user’s credentials.
sc Queries or controls Windows services.
schtasks Creates, deletes, queries, runs, and ends scheduled tasks.
shutdown Shuts down, restarts, logs off, or hibernates a computer.
systeminfo Displays detailed operating-system and hardware information.
takeown Lets an administrator take ownership of files or directories.
taskkill Ends processes by process ID or image name.
tasklist Lists running processes and their IDs.
time Displays or sets the system time.
ver Displays the Windows version.
verify Controls whether disk writes are verified.
whoami Displays the current user, groups, and privileges.
wmic Legacy Windows Management Instrumentation command-line interface; availability depends on Windows version and installation state.

Other useful commands

Command Purpose
assoc Displays or changes file-extension associations.
break Sets or clears extended Ctrl+C checking in supported command-shell behavior.
color Changes the foreground and background colors of the console.
date Displays or sets the system date.
fc Compares files line by line or byte by byte.
graftabl Enables Windows to display extended characters in graphics mode; a legacy command.
help Displays command descriptions and syntax.
mode Configures system devices and the console.
more Controls paged display of output.
path Sets the directories searched for executable commands.
reg Queries and modifies the Windows Registry.
typeperf Writes performance-counter data to the command window or a log.
verifier Configures Driver Verifier.

CMD syntax you need to know

Command-line notation

Microsoft’s syntax references use a consistent notation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Notation Meaning
<text> Required value that you supply.
[text] Optional value.
{text} Required choice or group.
| Choose one alternative.
… The preceding item may be repeated.

Text shown without brackets is typed literally. For example, in cmd /c <command>, replace <command> with the command to run.

Operators and redirection

Syntax Effect Example
| Pipes the first command’s output into the second. tasklist | findstr chrome
> Writes output to a file, replacing it. dir > files.txt
>> Appends output to a file. echo Done >> log.txt
& Runs commands sequentially regardless of the first command’s success. cd C:\Work & dir
&& Runs the next command only if the previous command succeeds. mkdir C:\Work\New && echo Created
|| Runs the next command only if the previous command fails. ping server || echo Unreachable

These operators test command completion status, not whether displayed text looks successful. A successful operation generally returns exit code 0; scripts should use exit codes rather than parse human-readable output.

Characters such as &, |, and parentheses have special meaning. Escape a literal special character with ^ or quote an argument where appropriate. Paths containing spaces must be quoted:

  • dir “C:\Program Files\Common Files”
  • echo A ^& B

Starting CMD with options

Option Effect
/c Runs the supplied command and exits.
/k Runs the supplied command and keeps the shell open.
/s Applies special quote-stripping rules with /c or /k.
/q Turns command echoing off.
/d Disables registry-configured AutoRun commands.
/a / /u Formats output as ANSI or Unicode.
/t:bf Sets background and foreground console colors.
/e:on / /e:off Enables or disables command extensions.
/f:on / /f:off Enables or disables file and directory completion.
/v:on / /v:off Enables or disables delayed environment-variable expansion.
/? Displays CMD’s command-line help.

The full syntax is cmd [/c|/k] [/s] [/q] [/d] [/a|/u] [/t:{<b><f> | <f>}] [/e:{on | off}] [/f:{on | off}] [/v:{on | off}] [<string>]. For example, this starts a one-off shell without registry AutoRun commands:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

cmd /d /c “set PATH”

Without /d, CMD checks these registry values before processing the command:

  • HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
  • HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

This means a new Command Prompt is not necessarily a clean shell. Also, quotes in cmd /c command strings are not always preserved; the result depends on the command string and the documented quoting conditions.

Environment variables and expansion

Use set to inspect or change the environment:

  • set lists all variables.
  • set USER lists variables whose names begin with USER.
  • set NAME=Alex creates or changes NAME.
  • set NAME= deletes NAME.

Variable names are case-insensitive, although CMD preserves the spelling used when displaying them. Standard expansion uses percent signs, such as echo %USERNAME% and echo %TEMP%. Delayed expansion uses exclamation marks and must be enabled, for example with cmd /v:on and echo !COUNT!.

Delayed expansion matters inside parenthesized batch blocks, where ordinary %VAR% expansion can occur before the block executes. Variable values are not recursively expanded indefinitely. An individual environment variable is limited to 8,192 bytes, and an environment block is limited to 65,536 characters. A child CMD process inherits its parent environment, but changes made in that child do not change the parent process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

FOR loop variants

for syntax differs between an interactive prompt and a batch file. At an interactive prompt use one percent sign; in a batch file use two:

  • Interactive: for %f in (*.txt) do echo %f
  • Batch file: for %%f in (*.txt) do echo %%f
Variant Use Example
for /d Processes matching directory names. for /d %d in (*) do echo %d
for /r Walks a directory tree recursively. for /r C:\Logs %f in (*.log) do echo %f
for /l Iterates over a numeric range. for /l %n in (1,1,5) do @echo %n
for /f Parses files, strings, or command output. for /f “tokens=*” %l in (file.txt) do echo %l

By default, for /f skips blank lines and takes the first whitespace-separated token from each line. Options such as delims=, tokens=, skip=, eol=, and usebackq change its parsing behavior.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Using FORFILES for date-based cleanup

forfiles applies a command to files matching a mask. For example, this lists matching log files on or before the date calculated as 30 days before the current date:

forfiles /P C:\Logs /M *.log /S /D -30 /C “cmd /c echo @path”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This uses date-based comparison semantics, not an exact rolling period of 30 times 24 hours. Absolute-date parsing depends on the device’s regional settings. Replacement variables include @FILE, @FNAME, @EXT, @PATH, @RELPATH, @ISDIR, @FSIZE, @FDATE, and @FTIME. Test with echo before substituting a destructive command such as del.

Common CMD mistakes

  1. Assuming help lists every runnable program. Use where to locate executables, and remember that third-party software may not appear in help.
  2. Using %%A at the interactive prompt. Use %A interactively and %%A in a batch file.
  3. Believing && always runs both commands. It runs the second command only after the first succeeds.
  4. Deleting the wrong path because of missing quotes. Quote paths such as “C:\Program Files\App”.
  5. Assuming CMD starts clean. Use cmd /d when registry AutoRun commands must not run.
  6. Expecting %VAR% to update inside a parenthesized block. Use delayed expansion with cmd /v:on and !VAR! when run-time expansion is required.
  7. Treating DiskPart commands as normal CMD commands. Start DiskPart, then use help inside its interpreter.
  8. Parsing printed success messages instead of exit codes. Use &&, ||, or inspect %ERRORLEVEL% in a script.

CMD or PowerShell?

CMD remains useful for short commands, legacy batch files, recovery environments, and compatibility with older Windows tools. Microsoft directs users who need more advanced scripting and automation toward PowerShell, which provides structured objects, richer error handling, modules, and more capable language features.

The shells do not always interpret the same command name the same way. CMD’s type displays text-file contents, while PowerShell’s type is an alias for Get-Content. Check which shell a script targets before copying commands between them.

FAQ

How do I display the complete CMD command list?

Open Command Prompt and run help. Run help command for details, such as help robocopy. This lists system commands available to that shell, not every executable installed on the computer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I find the executable used by a CMD command?

Run where command, for example where robocopy. By default, where searches the current directory and directories in PATH. Use where /r C:\Windows *.exe for a recursive search.

What is the difference between CMD and Command Prompt?

Command Prompt is the Windows application and user interface commonly used to launch cmd.exe. CMD or cmd.exe is the command processor that parses and runs commands and batch files.

Why does CMD show a different result from PowerShell?

They are different shells with different parsers, built-ins, aliases, quoting rules, and error behavior. For example, type is a CMD built-in but a PowerShell alias for Get-Content.

How do I get help for a command?

Use help command, such as help for or help set. Many standalone utilities also support /?, such as robocopy /?.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Are CMD commands case-sensitive?

Command names and environment-variable names are generally case-insensitive. FOR variable names are case-sensitive, and filenames or arguments can be affected by the behavior of the command receiving them.

The Bottom Line

For the command set available on a specific Windows installation, run help; for executable discovery, run where <pattern>. This catalog covers major Windows CMD commands, but DiskPart and similar tools have separate command languages, and installed software can add programs that are not part of CMD’s built-in help.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.