The Complete Windows Repair Toolkit: Every CMD Command You Need to Fix Windows 11

You are currently viewing The Complete Windows Repair Toolkit: Every CMD Command You Need to Fix Windows 11

Windows PCs don’t usually fail all at once. More often, problems build up gradually. Applications start crashing, Windows updates fail, network connectivity becomes unreliable, or the system simply feels slower than it used to.

Before you consider resetting or reinstalling Windows, there are several built-in repair tools that can diagnose and fix many common issues. Most of them can be accessed directly from Command Prompt or PowerShell with administrator privileges.

This guide covers the most useful Windows repair commands, what they do, and when you should use them.

Before You Start

Most commands in this guide require administrative privileges.

To open an elevated Command Prompt:

  1. Click the Start menu.
  2. Type CMD.
  3. Right-click Command Prompt.
  4. Select Run as administrator.
  5. Click Yes when prompted.

Keep the Command Prompt window open as you’ll be using it throughout the process.

1. Update Installed Applications with Winget

Many Windows problems are caused by outdated applications.

Windows includes a built-in package manager called Winget that can update supported applications automatically.

Run:

winget upgrade --all

This command scans installed applications and updates them to their latest versions.

If you’d prefer to review available updates first:

winget upgrade

To include additional applications that Winget can identify:

winget upgrade --all --include-unknown

Running this command once a month helps eliminate compatibility issues, bugs, and security vulnerabilities caused by outdated software.

2. Scan and Repair Disk Errors with CHKDSK

File system corruption and bad sectors can cause crashes, data corruption, and performance issues.

Start with a basic scan:

chkdsk

This performs a read-only analysis without making changes.

For repairs:

chkdsk C: /f

The /f switch fixes file system errors.

For a more comprehensive repair:

chkdsk C: /r

The /r switch:

  • Repairs file system errors
  • Scans for bad sectors
  • Attempts data recovery from damaged areas

Because Windows is using the C: drive, you’ll typically be asked to schedule the scan for the next reboot.

Type: Y

and restart your PC.

Use CHKDSK when:

  • The system crashes unexpectedly
  • Files become corrupted
  • A drive has experienced physical shock
  • Windows reports disk errors

3. Repair Corrupted Windows Files with SFC

System File Checker (SFC) verifies the integrity of protected Windows files.

Run:

sfc /scannow

The scan may take 10 to 15 minutes.

Possible results include:

No Problems Found

Windows Resource Protection did not find any integrity violations.

Problems Found and Fixed

Windows Resource Protection found corrupt files and successfully repaired them.

Problems Found but Not Fixed

Windows Resource Protection found corrupt files but was unable to fix some of them.

If SFC cannot repair everything, continue with DISM.

4. Repair the Windows Component Store with DISM

DISM repairs the Windows component store that SFC relies on for replacement files.

Run:

DISM /Online /Cleanup-Image /RestoreHealth

This command:

  • Downloads clean system components from Windows Update
  • Repairs corruption inside the component store
  • Restores Windows servicing functionality

An internet connection is required.

The process can take 15 to 20 minutes.

After DISM completes:

  1. Restart your PC.
  2. Run SFC again:
sfc /scannow

The DISM + SFC combination is one of the most effective Windows repair procedures available.

Additional DISM Health Checks

Quick health check:

DISM /Online /Cleanup-Image /CheckHealth

Detailed scan:

DISM /Online /Cleanup-Image /ScanHealth

Use these commands when you want to assess Windows image health before performing repairs.

5. Reset the Windows Network Stack

Many network issues are caused by corruption within Windows networking components.

Run:

netsh winsock reset

Then:

netsh int ip reset

And:

netsh int tcp reset

These commands reset:

  • Winsock catalog
  • TCP/IP stack
  • Network communication settings

Restart your PC after running them.

These repairs are useful when:

  • Browsers cannot access websites
  • Applications cannot connect online
  • Network behavior becomes inconsistent

6. Flush the DNS Cache

Corrupted DNS records can prevent websites from loading correctly.

Run:

ipconfig /flushdns

You’ll receive confirmation that the DNS cache has been cleared.

For a full network refresh:

ipconfig /release

Followed by:

ipconfig /renew

This sequence:

  1. Clears DNS records
  2. Releases the current IP address
  3. Obtains a fresh address from the router

It’s often the first troubleshooting step for internet connectivity issues.

7. Re-Register DNS Records

Useful primarily on business or domain-managed networks.

Run:

ipconfig /registerdns

This refreshes DNS registrations and updates hostname information.

It can help resolve:

  • Domain authentication issues
  • Hostname resolution failures
  • DNS registration problems

8. Reset Windows Firewall

Corrupted firewall rules can block legitimate traffic.

To restore Windows Firewall to its default configuration:

netsh advfirewall reset

This removes all custom firewall rules.

Use it carefully if your system relies on specialized firewall configurations.

9. Generate a Power Efficiency Report

If your laptop battery drains quickly or your PC refuses to sleep properly, Windows can generate a detailed diagnostic report.

Run:

powercfg /energy

Windows will monitor the system for approximately one minute and generate an HTML report.

The report can reveal:

  • Sleep prevention issues
  • USB devices causing wake events
  • Power policy misconfigurations
  • Battery-related warnings

10. Check Battery Health

Laptop users should periodically evaluate battery condition.

Run:

powercfg /batteryreport

Windows generates an HTML report showing:

  • Design capacity
  • Current full charge capacity
  • Charge history
  • Battery wear level
  • Estimated runtime

A battery that has dropped significantly below its original capacity may need replacement.

11. Test Your RAM with Windows Memory Diagnostic

Memory issues often cause:

  • Blue screens
  • Random crashes
  • Application failures
  • System instability

Windows includes a built-in RAM testing utility.

Open the Start menu and search for:

mdsched

Launch Windows Memory Diagnostic.

Choose either:

  • Restart now and check for problems
  • Check for problems the next time I start my computer

The test runs before Windows loads and can identify defective RAM modules.

See also: Run these 7 commands when your Internet connection stops working

Recommended Windows Repair Sequence

When troubleshooting a Windows system, use the following order:

General System Repair

winget upgrade --all
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow

Disk Repair

chkdsk C: /r

Network Repair

ipconfig /flushdns
ipconfig /release
ipconfig /renew
netsh winsock reset
netsh int ip reset
netsh int tcp reset
netsh advfirewall reset

Restart your PC after completing the network repairs.

Final Thoughts

Windows includes an impressive collection of built-in repair tools that many users never take advantage of. Before resorting to a reset or clean installation, these commands can often repair corrupted system files, resolve network issues, detect storage problems, and restore overall system stability.

Keeping this toolkit handy can save hours of troubleshooting and help extend the life of your Windows installation.

For most Windows issues, a combination of CHKDSK, DISM, SFC, and the network reset commands will resolve the problem without requiring a complete reinstall.

Leave a Reply