Essential Windows CMD Commands: Over 100 Most Useful Commands Organized by Function
This guide compiles more than 100 of the most practical and frequently used Windows Command Prompt commands, grouped into eight functional categories such as file management, system information, disk maintenance, network diagnostics, process control, batch scripting, user security, and handy utilities, each with a brief description and a concrete usage example.
Overview
The article presents a curated list of over 100 essential Windows CMD commands, focusing on commands that are still stable and useful in modern Windows 10/11 environments. Commands that are deprecated or rarely used have been removed.
1️⃣ File and Directory Management
dir– Displays files and folders in the current directory.
dir C:\Windows cd– Changes the current directory path.
cd .. md/ mkdir – Creates a new folder.
md NewFolder rd/ rmdir – Removes an empty directory.
rd OldFolder tree– Shows the directory hierarchy as a tree.
tree D:\ copy– Copies a file to a specified location.
copy a.txt D:\Backup\ xcopy– Copies files and directory trees.
xcopy /E Source Destination robocopy– Advanced copy tool with mirroring and resume support.
robocopy C:\Source D:\Target /MIR move– Moves or renames a file or directory.
move a.txt ..\Other\ del/ erase – Deletes files (supports wildcards).
del *.tmp ren/ rename – Renames a file or folder.
ren old.txt new.txt2️⃣ System Information and Management
systeminfo– Shows OS version, hardware configuration, and other overview data.
systeminfo winver– Pops up a window with the Windows version number.
winver ver– Displays the OS version in the console.
ver hostname– Shows the computer’s network name.
hostname whoami– Displays the currently logged‑in user name.
whoami driverquery– Lists installed drivers (use /V for verbose).
driverquery /V msinfo32– Opens the graphical System Information panel.
msinfo32 set– Shows or sets environment variables.
set PATH date– Displays or sets the system date.
date time– Displays or sets the system time.
time shutdown– Shuts down, restarts, or schedules a power operation.
shutdown /s /t 36003️⃣ Disk Management and Maintenance
diskpart– Enters the disk partitioning tool.
diskpart → list disk chkdsk– Checks and attempts to fix disk errors.
chkdsk C: /F format– Formats a disk partition.
format D: /FS:NTFS vol– Shows volume label and serial number.
vol D: label– Creates or changes a volume label.
label D: DataDisk defrag– Defragments a disk.
defrag C: /O convert– Converts a FAT volume to NTFS without data loss.
convert D: /FS:NTFS fsutil– Advanced file‑system management utility.
fsutil fsinfo drives wmic– Queries disk model, size, etc., via WMI.
wmic diskdrive get model,size4️⃣ Network Diagnosis and Configuration
ipconfig– Shows IP address and network configuration.
ipconfig /all ping– Tests network connectivity.
ping baidu.com -t tracert– Traces route hops.
tracert baidu.com netstat– Displays network connections and listening ports.
netstat -an nslookup– Queries DNS records.
nslookup baidu.com arp– Shows the ARP cache table.
arp -a getmac– Shows network adapter MAC addresses.
getmac /V route– Views or modifies the routing table.
route print pathping– Combines ping and traceroute with latency stats.
pathping baidu.com ftp– Enters FTP file‑transfer mode.
ftp ftp.example.com nbtstat– Shows NetBIOS over TCP/IP statistics.
nbtstat -n netsh– Network configuration scripting tool (e.g., reset network, view Wi‑Fi passwords).
netsh wlan show profile5️⃣ Process and Task Management
tasklist– Lists all running processes.
tasklist taskkill– Forces termination of a specific process.
taskkill /F /IM notepad.exe schtasks– Manages scheduled tasks.
schtasks /Query wmic process– Views detailed process information via WMI.
wmic process list brief start– Launches a new window to run a program.
start notepad.exe runas– Runs a program as another user.
runas /user:Administrator cmd6️⃣ Batch Scripting and Automation
echo– Displays a message or toggles command echoing.
echo Processing complete! @– Hides the command itself from being echoed.
@echo off pause– Pauses execution and prompts “Press any key to continue”.
pause rem– Adds a comment line.
rem This is a comment call– Calls another batch file and returns.
call anotherScript.bat goto– Jumps to a labeled line.
goto :end if– Conditional statement.
if exist file.txt del file.txt for– Loops over files or sets.
for %f in (*.txt) do echo %f set /P– Prompts for user input.
set /P name=Enter your name: exit– Exits the script or command interpreter.
exit /b color– Sets console foreground/background colors.
color 0A title– Sets the CMD window title.
title My Automation Tool7️⃣ User, Permissions, and Security
net user– Manages local user accounts.
net user NewUser Password /add net localgroup– Manages local groups.
net localgroup Administrators User /add net share– Manages shared folders.
net share ShareName=C:\Folder net use– Connects or disconnects network drives.
net use Z: \\Server\Share net accounts– Views account password policies.
net accounts takeown– Takes ownership of a file or folder.
takeown /F ProtectedFile.txt icacls– Displays or modifies file ACLs.
icacls Folder /grant User:F cipher– Encrypts or decrypts NTFS files.
cipher /E Secret.docx8️⃣ Handy Utilities
cls– Clears the screen.
cls exit– Closes the CMD window.
exit help– Shows a list of commands or help for a specific command.
help copy /?– Displays detailed syntax for a command.
ping /? cmd– Starts a new command session.
cmd /k powershell– Switches to PowerShell.
powershell notepad, calc, osk – Launches common Windows utilities. control, gpedit.msc, services.msc, eventvwr, msconfig, mstsc, dxdiag, cleanmgr – Opens various system management consoles.
Tips from the Author
Quickly open CMD: press Win+R, type cmd, and press Enter. For admin rights, use Win+X → “Terminal (Admin)”.
Paste in CMD by right‑clicking the mouse.
Get command help by appending /? (e.g., copy /?).
Remember to separate commands, parameters, and paths with spaces.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
IoT Full-Stack Technology
Dedicated to sharing IoT cloud services, embedded systems, and mobile client technology, with no spam ads.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
