Yes, you can instantly **list files, check disk space, or run system utilities** just by typing in the Command Prompt—not another GUI tool. This guide covers the most powerful, practical commands for Windows, from absolute beginners to power users.
What You'll Need
- Windows 10 or 11 (older versions have slightly different syntax).
- A PC with internet access for downloading tools like WinMerge or Sysinternals (if needed).
- Open Command Prompt (search for "cmd" in the Start menu).
Step-by-Step
- Open Command Prompt
- Press Win + R, type cmd, and hit Enter.
- On Windows 11, you can also right-click the taskbar and select New window under Command Prompt.
- Basic File Navigation
Move to a folder: Use
cd(change directory). For example,cd Documents.Shortcut:
cd ~goes to your home directory.List files in the current folder:
dir.The output includes file names, sizes, and modification dates.
List all files, including hidden ones:
dir /a.Use
dir /sto see files recursively (including subfolders).
- File Operations
Copy files:
copy sourcefile destination. Example:copy C:\Temp\file.txt D:\Backup\.Warning: If the destination folder doesn't exist, Command Prompt will prompt you again.
Move files:
move sourcefile destination. Example:move C:\Projects\oldfile.txt C:\Projects\newfolder\.Delete files:
del filename. Usedel /q filenameto delete silently.Warning: Deleted files are gone permanently unless you have backups.
Rename files:
ren oldname newname. Example:ren C:\Temp\oldfile.txt updatedfile.txt.
- System and Disk Utilities
Check disk space:
wmic os get freeDiskSpaceorwmic logicaldisk get size,freespace.Scan for viruses: Use
chkdsk /f C:(replaceC:with your drive letter). This fixes errors but may require rebooting.Restart your PC:
shutdown /r /t 0. This immediately restarts your computer.Shut down:
shutdown /s /t 0
- Networking Commands
Check connected network devices:
ipconfig /all.Look for IPv4 Address and Default Gateway to verify your network settings.
Ping a website:
ping google.com.Ping tests connectivity to the specified domain.
View open ports: Use
netstat -ano. Look for State showing ESTABLISHED.
- Advanced Commands
Search files with
where: Example:where notepad.exe.Redirect output:
dir > output.txtsaves thediroutput to a file.Use
forloops: Example to list all .txt files in a folder:for %f in (*.txt) do echo %f.
Common Mistakes
- Typo Errors
Spelling mistakes like
dirsinstead ofdirwill return an error. Always double-check commands. - Incorrect Paths
If you enter a non-existent folder like
cd Documents\, Command Prompt won’t move. Usecdalone to stay in the current folder. - Permissions Issues
Commands like
delormovemay fail if you lack write permissions. Run Command Prompt as Administrator.
Tips
Use Tab to autocomplete commands and paths. For example,
cd C:\W+ Tab fills inWindows.Press Ctrl+Shift+Enter to open a new Command Prompt window from the current one. This is useful for parallel operations.
For large files, use
xcopyinstead ofcopy. Example:xcopy C:\Temp\folder D:\Backup\ /E /Hcopies all subfolders, hidden files, and preserves attributes.Backup frequently: Use
copyorrobocopyto create copies of critical files.
Troubleshooting
Command Not Recognized
You may need to enable Command Prompt for your user. Go to Settings > Control Panel > Advanced System Settings > Advanced > Environment Variables and ensure Command Prompt is listed in the Path variable.
No Network Access
Check your network settings with
ipconfig /all. If you’re on Wi-Fi, verify the router IP address (usually192.168.1.1or192.168.0.1).Slow Performance
Run
tasklistto check for resource-heavy processes. Close unnecessary apps and restart Command Prompt.File Deletion Errors
If
delfails, useattrib -r -h filenameto remove read-only/hidden flags before deletion.
Frequently Asked Questions
Can I use Command Prompt for Python scripting?
Yes! Open a new Command Prompt window and type python script.py to run Python scripts directly. Ensure Python is added to your system PATH.
How do I find the installed programs via Command Prompt?
Use wmic product get name, version to list installed software and their versions.
What if Command Prompt won’t open?
Restart your PC or use the Task Manager (Ctrl+Shift+Esc) to force-close Command Prompt. If it still won’t open, check for system updates via wmic qfe list.
Can I use Command Prompt to edit files as text?
No. For text editing, use built-in editors like Notepad++ or Windows Notepad (with rich text). Command Prompt is for commands only.
What’s the difference between copy and xcopy?
copy only copies files; xcopy copies files and subfolders and includes options like /E (copy empty subfolders) and /H (copy hidden files).
How do I clear Command Prompt history?
Open the Command Prompt settings by typing cmd /k "setx /m path "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Command Prompt\cmd.exe" -- /a cmd.exe /k set history=0" in another window. Then restart Command Prompt.