
The Windows command prompt is a Swiss Army knife that, when used correctly, can get you out of trouble when your system is acting up. With just a few commands, you can diagnose, repair, and optimize your PC without getting lost in menus. And if you want to go beyond the basics, there are network, disk, and service utilities that let you audit your computer's performance in detail.
In the following lines, you'll find a comprehensive and unified guide to the essential Windows system diagnostic commands you need to know . It combines tools for network, storage, system, and performance, along with helpful tips, shortcuts, and special scenarios (including when it's best to reinstall). Everything is explained with practical examples, in clear and concise language.
Quick access to CMD and basic notions
To open Command Prompt, simply press Start and type CMD (right-click if you need to run it as administrator). If you prefer the Run dialog box, press Windows + R, type "cmd", and press Enter; for in-depth diagnostics, it's best to run it with elevated privileges.
Remember that any command displays its own help if you add /? to the end. This is very convenient for viewing parameters and examples from the manufacturer, for example: chkdsk /? or netsh / ?.
Basic console commands (move, list, copy, etc.)
Although simple, these commands lay the foundation for working smoothly in CMD; they allow you to navigate folders, sort content, and manage files without opening Explorer.
- CD: change directory (cd path) or use cd .. to go up a level.
- DIR: lists the contents of the current folder; ideal for confirming what's there before operating.
- TREE folder: draws the subdirectory tree of a given path.
- CLS: clears the console screen, useful for starting from scratch after several listings.
- EXIT: closes the CMD window.
- HELP: Displays the available commands with a brief description.
- COPY source destination: copies one or more files to the specified path.
- ROBOCOPY: Advanced alternative to COPY, faster and with resume and progress bar.
- MOVE: moves a file to another folder (does not leave a copy at the source).
- FROM the file/folder: deletes selected files or folders; be careful what you delete.
- RENAME file: renames files (including their extension, without format conversion).
- MD name: Creates a new folder in the current path.
- TYPE file.ext: allows you to write/dump content to a file from the console.
- FORMAT: formats a drive; dangerous if you don't know what you're doing.
System Diagnostics: Essential Commands
To check the status of the system, network, disks, and processes, Windows offers utilities that detect and correct errors quite independently . Here are the most commonly used ones:
- Systeminfo: system inventory (computer name, CPU, RAM, motherboards, patches…); ideal for quick audits.
- CHKDSK: Scans the drive in three phases and repairs logical errors and bad sectors. Example:
chkdsk C: /F /R/F repairs errors and /R attempts to recover data from damaged sectors.
- IPCONFIG: Connection data (IP, mask, gateway). You can filter IPv4 with:
ipconfig | find "IPv4"For all the details , use ipconfig /all.
- NETSTAT: TCP/UDP protocol and connection statistics. For example:
netstat -e -s netstat -n -o-or add the process PID.
- TRACERT host: hop route to a destination with hop times; latency and outage diagnosis.
- GETMAC: Displays the MAC address(es) of the computer.
- MORE: exact version of the operating system (build included); useful when validating requirements.
- CONTROL PANEL: Opens the Control Panel directly from CMD.
- TEAM: displays and allows you to set the system time; key for synchronization.
- DRIVERQUERY: Lists all installed drivers and their type.
- Tasklist: active processes and consumed memory; similar to Task Manager.
- TASKKILL /PID id: ends processes by PID (or by name with / IM).
- SFC: Checks and replaces protected system files. The most common: sfc / scannow.
- CLEANMGR: open disk cleanup (choose drive); useful shortcut from CMD.
- FORMAL WINSAT: system benchmark; supports variants such as CPUFORMAL, MEMFORMAL, GRAPHICSFORMAL, DISKFORMAL.
- Defrag: defragment the drive you indicate.
- DISKPART: manages disks and partitions (LIST DISK, LIST VOLUME…); powerful and delicate.
- Shutdown: shutdown/restart and even schedule shutdown (-s -t seconds) or restart with -r.
- Logoff: log out without turning off your computer.
DISM: Windows Image Servicing and Repair
When SFC isn't enough, DISM comes into play, operating on the Windows image (WinSxS) to locate and replace damaged components. It is recommended to run it in this order:
DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth
The first option quickly identifies known damage; it doesn't repair it . The second performs a deep scan, creates logs, and also doesn't repair it . The third option repairs the damage, but it can take a long time; if Windows Update isn't working, it defines a local source.
DISM /Online /Cleanup-Image /RestoreHealth /Source:C:/RepairSource/Windows /LimitAccess
DISM can write a change log if needed ( very useful in corporate environments ), and it's advisable to restart afterwards to apply everything correctly.
CHKDSK in depth: key parameters for NTFS
In addition to /F and /R, NTFS offers modern switches for adjusting scanning; they save you time or force offline actions when needed :
- /scan: : online examination of the unit (without rebooting unless necessary).
- /forceofflinefix: together with /scan, skips hot repairs.
- /perf: Speeds up analysis by using more of your computer’s resources.
- /spotfix: punctual correction of detected incidents.
- /sdcleanup: with /f, cleans unused security descriptors.
If the system drive check cannot be run at that moment, CHKDSK will suggest scheduling it for the next boot , which is normal and recommended if there are errors in use.
SFC: Checking Protected Files
SFC examines the integrity of critical files and restores copies from the system cache when it detects corruption. The most useful modes are:
- / scannow: examines and repairs everything protected.
- /verifyonly: just check, no repair.
- /scanfile y /verifyfile: they act on a specific route.
- /offbootdir, /offwindir, /offlogfile: Offline use and custom registration.
Typical final messages range from no violations to corrupted files that were successfully repaired , or that it was unable to fix some files (see CBS.log). If it says "the operation could not be completed," try running in Safe Mode.
Network: ipconfig and netsh for quick fixes
If the network malfunctions, start by renewing concessions and resetting Winsock; these two commands resolve a large proportion of incidents :
ipconfig /release
ipconfig /renew
netsh winsock reset
After resetting the Winsock catalog, restart your computer to apply the changes. If you continue to experience problems, check your drivers using `driverquery` and use `netstat` to check for open ports.
View help and examples for any command
To get the most out of each utility, add /? and you'll see parameters, a description, and often usage examples. It's a straightforward way to validate syntax and discover options you'd forgotten about.
Integrated problem solvers
Windows 10 and 11 include troubleshooters that detect and fix common problems (Internet, printers, updates, etc.). These are located in Settings: System > Troubleshoot (Windows 11) or Update & Security > Troubleshoot (Windows 10). If they don't fix the problem, they offer additional recommendations that you can apply manually.
When to reinstall instead of continuing to repair
Sometimes there's no other option: if the problems persist after SFC/DISM/CHKDSK, there's deeply embedded malware , the performance is terrible for no reason, critical updates failed , or you made major hardware changes (motherboard, disk, RAM…), a clean reinstall may be the most sensible thing to do to restore stability and compatibility.
Practical differences between SFC, DISM and CHKDSK
It's important to understand their scope to avoid wasting time: SFC repairs system files in use , DISM cleans the image Windows uses to rebuild itself (this is the next step), and CHKDSK deals with the disk and its file system . Depending on the symptom, choose one or the other, or run them in the appropriate order.
Deep Dive: 20 Useful Commands in Windows
Beyond the basics, Windows has an arsenal for diagnosing and managing networks; these 20 commands cover everything from connectivity to authentication and routing.
- PING: Checks ICMP connectivity and round-trip times. Example:
ping -n 5 8.8.8.8At the output, check for lost packets , latency, and response TTL .
- IPCONFIG: already seen, but remember that it filters IPv4:
ipconfig | find "IPv4"For adapter description:
ipconfig /all | find "Descripción" - HOSTNAME: displays the team name; you can also get it with ipconfig /all | find "Hostname" o echo %userdomain%.
- GETMAC: MAC addresses per adapter; alternates with:
ipconfig /all | find "Dirección física" - ARP: ARP table and entry management. View it with:
arp /aUseful for debugging IP->MAC resolutions.
- Nslookup: DNS queries in non-interactive or interactive mode. For example:
nslookup openwebinars.net 8.8.8.8 - Nbtstat: NetBIOS name statistics and cache over TCP/IP:
nbtstat /n nbtstat /c nbtstat /S 5 nbtstat /R nbtstat /RR - NETSTAT: already seen; adds -p tcp udp to define protocols.
- NET USE: Map shared resources and printers; for example, map a temporary drive:
net use * \\servidor\mi_unidad /persistent:no/persistent: does not prevent remapping upon login.
- TASKKILL remote: closes processes remotely by authenticating credentials:
taskkill /s remote_host /u dominio\usuario /p MiP@ssW0rd /fi "IMAGENAME eq nota*" /im * - Remote SHUTDOWN: Restart or shut down other computer with message and delay:
shutdown /r /m \\mi_servidor /t 60 /c "Reconfiguración miapp.exe" /f /d p:4:1 - Tracert: real example to a public host and option /d to avoid resolving names:
tracert openwebinars.net tracert /d openwebinars.net - PathPing: combines traceroute and sustained pings per hop to calculate loss and latency intermediate:
pathping openwebinars.net - TELNET: optional client (must be installed) to test legacy ports and services:
telnet telnet.microsoft.com telnet /f telnetlog.txt telnet.microsoft.com 44 - ROUTE: Prints and manipulates the routing table (IPv4/IPv6). Examples:
route PRINT route PRINT -4 route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2 route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2 route DELETE 157.0.0.0 - Netsh: Network shell for configuring stacks, profiles, and more. TCP/IP reset and WLAN example:
netsh int ip reset netsh int ip reset C:\tcpipreset.txt netsh wlan show profile name="FullDevOps" key=clear - WINRM: remote administration via WS-Management, very useful on servers:
winrm get winrm/config -format:pretty winrm get wmicimv2/Win32_Service?Name=spooler winrm set winrm/config @{MaxEnvelopeSizekb="100"} winrm set winrm/config/Listener?Address=*+Transport=HTTPS @{Enabled="false"} winrm delete winrm/config/Listener?Address=IP:192.168.2.1+Transport=HTTP - WGET: Free downloadable utility with retries and recursive mode (on Windows, modern alternative to bitsadmin):
wget http://example.com/archivo.iso wget --output-document=pagina.html https://example.com wget --directory-prefix=carpeta/subcarpeta https://example.com wget --continue https://example.com/big.file.iso wget --continue --timestamping https://wordpress.org/latest.zip - FTP: Interactive or batch file transfer; supports IPv6 and its own subenvironment:
ftp -s:resync.txt ftp.example.microsoft.comIn interactive mode, you will see the ftp > prompt and you will be able to authenticate and browse the server.
- SSH/SCP: Since Windows 10, the OpenSSH client is integrated; secure connection and copy:
ssh usuario@dominio_o_ip ssh -l usuario dominio_o_ip scp ubuntu@mi_servidor.com:/etc/servicio/definitions.json C:/Users/TuUsuario/Downloads/new-definitions.json
More diagnostic and management utilities
Depending on the problem, these commands will help you get straight to the point; they cover power, performance, registry, and backups, among other things:
- msconfig: configure startup and services.
- WMIC: WMI CLI interface for administrative data and action.
- powercfg: Power and battery reports; consumption diagnosis.
- perfmon: Opens Performance Monitor.
- eventvwr: Launches the Event Viewer for detailed errors/warnings.
- regedit: Registry Editor (carefully).
- systempropertiesadvanced: advanced system properties (performance, profiles…).
- diskmgmt: Disk Manager in GUI.
- cipher: Manages EFS encryption on files/folders.
- wbadmin: Windows Backup and Restore.
Keyboard Shortcuts and Productivity (Windows 7/8/10/11)
Shortcuts speed up your work and often replace several clicks with a single tap ; combine the following according to your workflow:
- F1 (contextual help), F3 (look for), Alt + F4 (close app), Ctrl + Esc (Start), Windows + L (block/change user), Windows + CODE (minimize all), Windows + E (Explorer), Windows + Pause (System Properties), Alt + D (address bar).
- Ctrl + W (close active window), Ctrl + O (open), Ctrl + Y (repeat), Alt + Space (window menu), Ctrl + F4 (close MDI document).
- Windows + Space (language/keyboard), Shift + Delete (permanent delete), Windows + Start (minimize everything except the active window), Windows + Tab (task view), Windows+A (Activity Center), Alt + Tab (change window), Windows + C (Cortana voice, if applicable).
- Extras: Windows + P (screen), Windows + + (Magnifying glass), Windows + X (advanced menu), Windows + break (Properties).
The Fn key and special combinations vary depending on the manufacturer/model; on many computers they help to edit commands or control functions (brightness, volume, backlit keyboard) without interrupting your workflow.
Windows Server: Five Console Essentials
On servers, CMD and PowerShell are everyday tools; these five will quickly clear up your doubts :
ipconfig /all
netstat -a
nslookup openai.com
sfc /scannow
gpupdate /force
Between diagnoses and policy changes, remember to document modifications and validate results in the Event Viewer.
Brief background: Windows and its evolution
From MS-DOS to today, Windows has evolved from a pure command-line interface to graphical environments; Windows 1.0, 2.0, and 3.0 introduced managers and control panels that we now take for granted. Although the GUI now dominates, the command prompt (CMD) remains essential for advanced tasks.
Privacy and Cookie Notices
Many websites display consent banners (for example, notices like “We value your privacy” ) to improve quality, personalize content, and measure advertising. Accepting all or rejecting non-essential content depends on your preferences; it does not affect the functionality of these commands on your PC.
FAQ
- What if DISM/SFC/CHKDSK don't fix the problem? You can use the system troubleshooters; if after several passes they fail or the system remains unstable, consider reinstallation.
- Is it safe to run them whenever you want? Yes, with administrator permissions and without interrupting the processes. CHKDSK on the system drive may require a reboot.
- How long it takes? It depends on the size of the disk, number of files and degree of damage; It can be minutes or several hours (especially DISM/CHKDSK).
- Are they only for advanced users? No, if you follow the recommended order and instructions; the system itself automates repairs.
- Risk to my personal data? SFC and DISM act on system files; CHKDSK can flag bad sectors and, in rare cases, some data in those areas is lostIt's always a good idea to make a copy in advance.
Mastering these commands lets you go from theory to action: diagnose your network with ping, tracert, or pathping , repair Windows with SFC/DISM, clean disks with CHKDSK , and save time with shortcuts and utilities like driverquery, eventvwr, or netsh. With a clear strategy (help /?, correct tool order, and backups), you'll resolve most issues without reinstalling.