Love for Technology← All articles
Windows
Windows diagnostic commandsWindows troubleshooting

Top Windows Diagnostic Commands to Troubleshoot Any Problem

12 September 2026· Updated 11 November 2026 ·
Essential Windows diagnostic commands in Command Prompt

Below you'll find a quick overview of every troubleshooting method covered in this guide. Jump directly to the section you need, or follow them in order for a complete Windows diagnostic and repair process.

Is your Windows PC suddenly running slower than usual, freezing without warning, or refusing to install updates? Problems like these are surprisingly common—and in many cases, they're much easier to fix than most people think.

Slow startup times, unstable internet connections, Windows Update failures, application crashes, missing drivers, and random system errors can quickly turn a productive day into a frustrating one. Fortunately, most of these issues don't require expensive repair services or advanced technical knowledge to resolve.

⚡ Quick Fix: Before trying advanced troubleshooting, restart your PC, install any pending Windows updates, and disconnect unnecessary USB devices. These simple steps solve many common Windows problems and are always worth trying first.

One of the biggest advantages of Windows is the collection of built-in troubleshooting and recovery tools included with every installation. From repairing corrupted system files and fixing network problems to diagnosing hardware issues and restoring system stability, these utilities can often resolve problems automatically with just a few clicks.

Combined with a few simple maintenance habits—such as keeping drivers updated, managing startup applications, and checking available storage—you can often restore lost performance and prevent many issues from returning.

In this guide, you'll learn practical, step-by-step solutions for some of the most common Windows problems. Whether your computer feels unusually slow, keeps displaying error messages, struggles to connect to the internet, or simply isn't behaving as expected, these proven troubleshooting methods will help you get your PC back to peak performance—quickly, safely, and without unnecessary complexity.

In this guide
01 ⚡ Quick Command Reference02 1️⃣ System File Repair (sfc /scannow)03 2️⃣ Advanced System Repair (DISM)04 3️⃣ Disk Check and Repair (chkdsk)05 4️⃣ Fix Network Issues (ipconfig)06 5️⃣ Connection Testing (Ping & Tracert)07 6️⃣ Manage Running Programs (Tasklist & Taskkill)08 Before You Repair Windows: Three Checks That Save Time09 DISM and SFC: What to Run First and How to Read the Results10 CHKDSK: Scan First, Repair Only When Needed11 How to Tell a DNS Problem From a Wi-Fi or Internet Outage12 Four More Built-In Commands Worth Knowing13 Common Mistakes to Avoid14 🎯 Summary15 Quick safety checklist16 Frequently asked questions

⚡ Quick Command Reference

Use this table to quickly identify the correct command before following the detailed instructions later in the guide.

Problem Command Purpose
🛠️ Corrupted system files sfc /scannow Scans and repairs damaged Windows system files.
🧩 Windows image corruption DISM /Online /Cleanup-Image /RestoreHealth Repairs the Windows image used by System File Checker.
💽 Disk errors chkdsk C: /f Checks and repairs file system errors.
🌐 Websites won't load ipconfig /flushdns Clears the DNS cache and refreshes stored website records.
🔄 Network connection problems ipconfig /release
ipconfig /renew
Requests a new IP address from your router.
📡 Test internet connectivity ping google.com Checks internet connectivity and response time.
🗺️ Locate network delays tracert google.com Shows every network hop to the destination.
❌ Close a frozen application taskkill /IM app.exe /F Force closes an unresponsive application.

💡 Quick Tip: There's no need to run every command in this guide. Start with the tool that matches your specific problem. For example, use IPConfig for network issues, CHKDSK for disk errors, DISM followed by SFC for corrupted Windows files, and Taskkill for frozen applications.

🛡️ Before You Begin: Most commands in this guide require an elevated Command Prompt. Press the Windows key, type cmd, right-click Command Prompt, and select Run as administrator.

1️⃣ System File Repair (sfc /scannow)

Fix Windows system issues using the SFC System File Checker tool

The System File Checker (SFC) scans protected Windows system files for corruption or missing components and automatically replaces damaged files with healthy copies. It's one of the first tools you should run if Windows starts crashing, freezing, or behaving unexpectedly.

How to use it:

  1. Press the Windows key and type cmd.
  2. Right-click Command Prompt and choose Run as administrator.
  3. Type the following command and press Enter:
sfc /scannow

The scan usually takes between 10 and 30 minutes, depending on your PC. Wait until it reaches 100% before closing the Command Prompt window.

💡 Pro Tip: If SFC reports that it couldn't repair all files, run the DISM commands in the next section first, then execute sfc /scannow again.

2️⃣ Advanced System Repair (DISM)

Using the DISM RestoreHealth command to repair the Windows system image

DISM (Deployment Image Servicing and Management) repairs the Windows system image used by SFC. If that image is damaged, SFC may not be able to replace corrupted files correctly. Running DISM first often resolves deeper system corruption.

How to use it:

  1. Open Command Prompt as an administrator.
  2. Check whether the Windows image is damaged:
DISM /Online /Cleanup-Image /CheckHealth

If Windows detects corruption, run the repair command below:

DISM /Online /Cleanup-Image /RestoreHealth

After DISM finishes successfully, restart your computer and run sfc /scannow again to verify that all system files have been repaired.

⚡ Important: The repair process may take 30–60 minutes or longer. Even if the progress appears stuck for several minutes, don't interrupt it or restart your PC.

3️⃣ Disk Check and Repair (chkdsk)

Checking and repairing Windows disk errors with the chkdsk command

If your PC crashes unexpectedly, reports disk errors, or files become corrupted, CHKDSK (Check Disk) can scan your drive for file system problems and repair many logical errors automatically. It's useful for both SSDs and traditional hard drives.

If your computer is extremely slow, freezes frequently, or sounds like it’s struggling, the issue may be related to your hard drive. The chkdsk command performs a full scan, detects errors, and attempts to fix them automatically.

chkdsk C: /f /r /x

What each parameter means:

  1. /f = Automatically fixes detected errors
  2. /r = Locates and repairs bad sectors
  3. /x = Forces the drive to dismount before the scan
🔄 Warning: If you scan the main drive (C:), Windows will require a restart. The scan will run before the system boots and may take a considerable amount of time.

4️⃣ Fix Network Issues (ipconfig)

Troubleshoot Windows network problems using IPConfig commands

If your internet connection suddenly drops, websites refuse to load, or your PC struggles to connect to the network, the built-in IPConfig utility can help diagnose and resolve many common networking issues without installing additional software.

📋 View Network Configuration

ipconfig /all

Displays complete network information, including your IP address, DNS servers, gateway, MAC address, DHCP status, and all installed network adapters.

🔄 Renew Your IP Address

ipconfig /release
ipconfig /renew

Releases your current IP address and requests a new one from your router or DHCP server. This often resolves temporary network configuration problems.

🧹 Flush DNS Cache

ipconfig /flushdns

Clears outdated DNS records stored on your computer. This can resolve problems caused by incorrect or outdated website address information.

🔍 View Cached DNS Records

ipconfig /displaydns

Displays all DNS records currently stored in Windows, making it easier to troubleshoot DNS-related problems.

🌐 Quick troubleshooting order: If websites won't load correctly, first run ipconfig /flushdns. If the problem continues, use ipconfig /release followed by ipconfig /renew to obtain a fresh IP address from your router.

5️⃣ Connection Testing (Ping & Tracert)

Test internet connectivity with Ping and Tracert in Windows Command Prompt

Ping and Tracert are two of the most useful diagnostic commands in Windows. They help determine whether a connectivity problem originates from your computer, your local network, your router, your ISP, or somewhere else on the internet.

🏓 Test your internet connection

ping google.com

If you receive replies with response times such as 18 ms or 35 ms, your internet connection is working correctly. Messages such as Request timed out, Destination host unreachable, or General failure usually indicate a network or connectivity problem.

🗺️ Trace the network route

tracert google.com

This command displays every network "hop" between your computer and the destination server. It helps identify where delays or failures occur, making it easier to determine whether the issue is inside your home network, with your internet provider, or somewhere farther along the route.

💡 Pro Tip: If ping works but websites still won't load, the problem is often related to DNS rather than your internet connection. In that case, try running ipconfig /flushdns or changing your DNS server to a public provider such as Cloudflare (1.1.1.1) or Google DNS (8.8.8.8).

6️⃣ Manage Running Programs (Tasklist & Taskkill)

Manage running Windows processes using Tasklist and Taskkill commands

If an application freezes or stops responding, you don't always need to restart your computer. Windows includes built-in commands that let you identify running processes and safely terminate the one causing the problem.

📋 View all running processes

tasklist

This command displays every active process along with its Process ID (PID), memory usage, and executable name.

❌ Close a program using its PID

taskkill /PID 1234 /F

Replace 1234 with the PID shown by the tasklist command.

🚀 Close a program by its name

taskkill /IM notepad.exe /F

This method is often easier because you don't need to look up the process ID first.

⚠️ Important: Only terminate applications you recognize. Ending essential Windows processes may cause programs—or even Windows itself—to become unstable until you restart your computer.
START HERE

Before You Repair Windows: Three Checks That Save Time

A repair command is most useful when you know what you are trying to fix. First, save your work and restart the computer once. A restart clears temporary glitches, but it does not repair corrupted files or failing hardware.

Next, check whether the problem started after a driver update, a newly installed app, or a Windows update. If so, reversing that specific change may be faster than running several unrelated commands. Finally, back up irreplaceable files before disk repairs. If the drive clicks, repeatedly disconnects, or reports SMART warnings, prioritize data recovery rather than stressing it with repeated scans.

To open an elevated terminal in Windows 11, right-click Start and choose Terminal (Admin), or search for Command Prompt and select Run as administrator. Not every diagnostic command needs administrator privileges, but system repairs usually do.

REPAIR ORDER

DISM and SFC: What to Run First and How to Read the Results

These tools do different jobs. DISM repairs the Windows component store that supplies replacement files, while SFC checks protected system files. For suspected component-store corruption, run DISM first and then SFC. If the problem is minor, running SFC alone is also a reasonable first test.

1 · Repair the component storeDISM /Online /Cleanup-Image /RestoreHealth2 · Check protected system filessfc /scannow

Allow both scans to finish. A percentage that appears stuck is not necessarily a failure. DISM may require access to Windows Update; on a disconnected PC or one with damaged update components, an appropriate local repair source may be needed.

If SFC reports that it repaired corrupted files, restart and test the original issue. If it reports that some files could not be repaired, run DISM and repeat SFC. If errors persist, review C:\Windows\Logs\CBS\CBS.log or consider a Windows repair installation after backing up your data.

DISK HEALTH

CHKDSK: Scan First, Repair Only When Needed

For a first look at file-system status, use chkdsk C: without repair switches. The command reports findings without attempting to fix them. Use chkdsk C: /f when file-system errors need repair; Windows may schedule the operation for the next reboot because the system volume is in use.

The /r option adds a search for unreadable sectors and attempts to recover readable information. It can take much longer, especially on large hard drives, and is not a routine maintenance step. CHKDSK does not replace a backup, does not restore a physically failing disk, and should not be treated as a general performance booster.

Important distinction: File-system errors and physical drive failure are different problems. If your drive is failing, copy important files to a healthy disk before attempting further repairs.
NETWORK DIAGNOSIS

How to Tell a DNS Problem From a Wi-Fi or Internet Outage

Start with ipconfig /all to check your IP address, default gateway and DNS servers. Then test your router's gateway address with ping. If the router responds, try ping 1.1.1.1 to test external IP connectivity. Finally, try nslookup example.com to see whether DNS can resolve a domain name.

If external IP connectivity works but domain lookups fail, DNS is a likely suspect. Try ipconfig /flushdns to clear the local resolver cache. It does not repair a disconnected Wi-Fi adapter or a broadband outage. Use ipconfig /release and ipconfig /renew only when you actually need to refresh a DHCP lease; they can briefly interrupt your connection.

Remember that some networks block ICMP ping requests. A failed ping by itself does not prove that a website or service is offline. Combine tests with a browser check and Windows' built-in network status.

EXTRA DIAGNOSTICS

Four More Built-In Commands Worth Knowing

systeminfo

Shows Windows version, installation information, system model, memory and recent boot details. Useful when you need to describe your computer to support.

driverquery

Lists installed drivers. It helps you investigate driver-related symptoms, but does not tell you automatically which driver is faulty.

netstat -ano

Lists active network connections and their process IDs. Match a PID with Task Manager before deciding whether a connection is unexpected.

powercfg /batteryreport

On supported laptops, generates an HTML battery report with design capacity and recent usage. It is a diagnostic estimate, not a laboratory measurement.

For repeat crashes, Reliability Monitor (perfmon /rel) can be more informative than a repair command: it shows a timeline of application failures, Windows failures and updates, helping you identify when the problem began.

PRACTICAL CHECKLIST

Common Mistakes to Avoid

  • Do not run every repair command simply because the PC feels slow; identify the symptom first.
  • Do not force-close unknown system processes with taskkill /F; you may lose unsaved work or destabilize the session.
  • Do not confuse a successful scan with a guaranteed fix for hardware faults, overheating or failing memory.
  • Do not run lengthy disk repair operations without backing up important files.
  • Record the exact error message and test whether the original symptom has disappeared after each step.

These habits make troubleshooting easier to repeat and prevent unnecessary changes. If the same issue returns after successful repairs, look for the underlying cause rather than running the same command indefinitely.

🎯 Summary

Windows includes a surprisingly powerful collection of built-in troubleshooting tools. Whether you're dealing with corrupted system files, slow performance, disk errors, network problems, or frozen applications, these commands can often solve the issue without third-party software or a complete Windows reinstall.
⚡ Recommended troubleshooting order:
  1. DISM – Repair the Windows image.
  2. SFC – Repair corrupted system files.
  3. CHKDSK – Check the drive for file system errors.
  4. IPConfig – Refresh your network configuration if internet problems occur.
  5. Ping & Tracert – Diagnose connection issues.
  6. Tasklist & Taskkill – Close frozen applications without restarting Windows.
Running these tools whenever Windows starts behaving unexpectedly can restore stability, improve performance, and often prevent hours of unnecessary troubleshooting.
🛠️ Preventive maintenance:
Run SFC, DISM, or CHKDSK when symptoms suggest system-file or disk errors. There is no need to run all three on a fixed schedule; regular backups and updates are more useful preventive habits.
💾 Save this guide:
Bookmark this page or keep it in your browser favorites. Having these commands readily available can save valuable time the next time Windows develops an unexpected problem.

Quick safety checklist

Before changing anything, save open work and back up important files. Start with read-only checks when available, copy the exact command rather than guessing switches, and allow repair operations to finish. If the drive is clicking, disconnecting, or reporting critical health warnings, prioritize a backup over repeated repair attempts.

Frequently asked questions

Should I run SFC or DISM first?

If Windows Update or the component store appears damaged, run DISM /Online /Cleanup-Image /RestoreHealth first, then sfc /scannow. SFC can also be a sensible first check for isolated system-file problems.

Does CHKDSK delete my files?

A normal scan does not intentionally delete personal files, but repairing an already failing drive carries risk. Back up important files before running repair options.

Do these commands work in Windows 11?

Yes. Most commands described here work in Windows 10 and Windows 11, although some output and menus can differ.

Do I need administrator permissions?

DISM repair, SFC repair and some CHKDSK options generally require an elevated Command Prompt or Windows Terminal. Ping and basic IP configuration checks usually do not.

What if DISM cannot find source files?

Check the internet connection and Windows Update health. An appropriate matching Windows installation image may be needed as a repair source.

Can these commands fix a failing SSD?

No. Software diagnostics may identify errors, but cannot repair worn-out or physically failing hardware. Back up data and check drive health if problems persist.

0%
Share this article

💬 Comments

Loading comments…