Windows CMD commands offer powerful tools for managing and controlling your computer. These text-based instructions let users perform tasks quickly and efficiently. CMD.exe, the Windows Command Prompt, provides access to over 280 built-in commands for file management, network troubleshooting, and system configuration.
The Command Prompt gives users direct control over their Windows operating system. It’s a versatile tool for both basic and advanced operations. Users can automate tasks with batch files and scripts, making repetitive processes easier.
CMD commands work on Windows 10, 11, and earlier versions. They range from simple directory navigation to complex system maintenance. Learning these commands can boost productivity and deepen understanding of Windows systems.
CMD Commands List
ASSOC | Displays or modifies file extension associations. |
ATTRIB | Displays or changes file attributes. |
BREAK | Sets or clears extended CTRL+C checking. |
BCDEDIT | Sets properties in boot database to control boot loading. |
CACLS | Displays or modifies access control lists (ACLs) of files. |
CALL | Calls one batch program from another. |
CD | Displays the name of or changes the current directory. |
CHCP | Displays or sets the active code page number. |
CHDIR | Displays the name of or changes the current directory. |
CHKDSK | Checks a disk and displays a status report. |
CHKNTFS | Displays or modifies the checking of disk at boot time. |
CLS | Clears the screen. |
CMD | Starts a new instance of the Windows command interpreter. |
COLOR | Sets the default console foreground and background colors. |
COMP | Compares the contents of two files or sets of files. |
COMPACT | Displays or alters the compression of files on NTFS partitions. |
CONVERT | Converts FAT volumes to NTFS. You cannot convert the current drive. |
COPY | Copies one or more files to another location. |
DATE | Displays or sets the date. |
DEL | Deletes one or more files. |
DIR | Displays a list of files and subdirectories in a directory. |
DISKPART | Displays or configures Disk Partition properties. |
DOSKEY | Edits command lines, recalls Windows commands, and creates macros. |
DRIVERQUERY | Displays current device driver status and properties. |
ECHO | Displays messages, or turns command echoing on or off. |
ENDLOCAL | Ends localization of environment changes in a batch file. |
ERASE | Deletes one or more files. |
EXIT | Quits the CMD.EXE program (command interpreter). |
FC | Compares two files or sets of files, and displays the differences between them. |
FIND | Searches for a text string in a file or files. |
FINDSTR | Searches for strings in files. |
FOR | Runs a specified command for each file in a set of files. |
FORMAT | Formats a disk for use with Windows. |
FSUTIL | Displays or configures the file system properties. |
FTYPE | Displays or modifies file types used in file extension associations. |
GOTO | Directs the Windows command interpreter to a labeled line in a batch program. |
GPRESULT | Displays Group Policy information for machine or user. |
GRAFTABL | Enables Windows to display an extended character set in graphics mode. |
HELP | Provides Help information for Windows commands. |
ICACLS | Display, modify, backup, or restore ACLs for files and directories. |
IF | Performs conditional processing in batch programs. |
LABEL | Creates, changes, or deletes the volume label of a disk. |
MD | Creates a directory. |
MKDIR | Creates a directory. |
MKLINK | Creates Symbolic Links and Hard Links |
MODE | Configures a system device. |
MORE | Displays output one screen at a time. |
MOVE | Moves one or more files from one directory to another directory. |
OPENFILES | Displays files opened by remote users for a file share. |
PATH | Displays or sets a search path for executable files. |
PAUSE | Suspends processing of a batch file and displays a message. |
POPD | Restores the previous value of the current directory saved by PUSHD. |
Prints a text file. | |
PROMPT | Changes the Windows command prompt. |
PUSHD | Saves the current directory then changes it. |
RD | Removes a directory. |
RECOVER | Recovers readable information from a bad or defective disk. |
REM | Records comments (remarks) in batch files or CONFIG.SYS. |
REN | Renames a file or files. |
RENAME | Renames a file or files. |
REPLACE | Replaces files. |
RMDIR | Removes a directory. |
ROBOCOPY | Advanced utility to copy files and directory trees |
SET | Displays, sets, or removes Windows environment variables. |
SETLOCAL | Begins localization of environment changes in a batch file. |
SC | Displays or configures services (background processes). |
SCHTASKS | Schedules commands and programs to run on a computer. |
SHIFT | Shifts the position of replaceable parameters in batch files. |
SHUTDOWN | Allows proper local or remote shutdown of machine. |
SORT | Sorts input. |
START | Starts a separate window to run a specified program or command. |
SUBST | Associates a path with a drive letter. |
SYSTEMINFO | Displays machine specific properties and configuration. |
TASKLIST | Displays all currently running tasks including services. |
TASKKILL | Kill or stop a running process or application. |
TIME | Displays or sets the system time. |
TITLE | Sets the window title for a CMD.EXE session. |
TREE | Graphically displays the directory structure of a drive or path. |
TYPE | Displays the contents of a text file. |
VER | Displays the Windows version. |
VERIFY | Tells Windows whether to verify that your files are written correctly to a disk. |
VOL | Displays a disk volume label and serial number. |
XCOPY | Copies files and directory trees. |
WMIC | Displays WMI information inside interactive command shell. |
Essential Windows CMD Commands
The Windows Command Prompt (CMD) is a powerful tool. It lets you interact with your computer using text-based commands. Here’s a list of essential CMD commands that every Windows user should know:
Basic Navigation and File Management
- dir: Lists files and folders in the current directory.
- cd: Changes the current directory. For example, “cd Documents” moves you to the Documents folder.
- mkdir: Creates a new directory. “mkdir NewFolder” creates a folder named “NewFolder.”
- rmdir: Removes an empty directory.
- del: Deletes files. Use with caution!
- copy: Copies files from one location to another.
- move: Moves files from one location to another.
- ren: Renames a file or folder.
System Information and Control
- systeminfo: Displays detailed information about your computer’s hardware and software.
- tasklist: Shows a list of running processes.
- taskkill: Ends a running process. You’ll usually need to specify the process ID (PID).
- shutdown: Shuts down or restarts your computer. You can add arguments like “/r” for restart or “/s” for shutdown.
- gpupdate: Refreshes Group Policy settings.
Networking
- ipconfig: Displays your computer’s network configuration details, including IP address.
- ping: Tests the connection to another device on the network. For example, “ping google.com” checks if you can reach Google’s servers.
- tracert: Traces the route that packets take to reach a specific destination.
- netstat: Displays active network connections.
Disk Management
- chkdsk: Checks a disk for errors and attempts to fix them.
- diskpart: A powerful tool for managing disks, partitions, and volumes.
- format: Formats a drive (erases all data!).
Other Useful Commands
- help: Provides information about a specific command. For example, “help copy” shows details about the copy command.
- cls: Clears the Command Prompt screen.
- date: Displays or sets the current date.
- time: Displays or sets the current time.
Tips for Using CMD
- Most commands have options (arguments) that modify their behavior. Use the “/?” switch after a command to see its available options. For example, “dir /?”
- You can use the Tab key to autocomplete commands and file/folder names.
- Use the arrow keys to scroll through your command history.
Command | Description |
---|---|
dir | Lists files and folders |
cd | Changes the directory |
mkdir | Creates a new directory |
systeminfo | Shows system information |
ipconfig | Displays network configuration |
ping | Tests network connectivity |
chkdsk | Checks disk for errors |
Key Takeaways
- CMD commands offer powerful control over Windows systems
- Users can automate tasks with batch files and scripts
- The Command Prompt works on multiple Windows versions
Core Command Line Operations
Windows Command Prompt offers powerful tools for system management and file operations. These commands let users control their computer through text-based inputs.
Navigating the File System
The “cd” command changes directories. Type “cd foldername” to move into a folder. Use “cd ..” to go up one level. “dir” lists files and folders in the current directory. It shows names, sizes, and dates. “tree” displays the folder structure as a tree diagram. This helps visualize file organization. “path” shows or sets the system path. The path tells Windows where to look for programs.
File Management
“copy” duplicates files. “move” relocates files. “del” erases files. Use these with caution. “ren” renames files or folders. “mkdir” or “md” creates new folders. “rmdir” removes empty folders. “type” displays the contents of text files. “fc” compares two files and shows differences. “attrib” changes file attributes like hidden or read-only. These commands help organize and maintain files efficiently.
System Information Commands
“systeminfo” gives a detailed report of the computer’s hardware and software. “hostname” shows the computer’s name. “tasklist” displays running processes. “taskkill” ends specific processes. “sfc” scans and repairs Windows system files. “chkdsk” checks the hard drive for errors. “diskpart” manages disk partitions. These tools help diagnose and fix system issues.
Network Utilities
“ping” tests network connections. “ipconfig” shows network settings. “tracert” traces the route to a website. “netstat” displays network statistics. “nslookup” queries domain name servers. “net” manages network resources and users. “getmac” retrieves the MAC address. “pathping” combines ping and tracert functions. These commands are vital for network troubleshooting and setup.