Windows Repair Commands in CMD: The Ultimate Guide to Fixing Common PC Problems



If your Windows PC is running slowly, crashing unexpectedly, or showing strange errors, the solution might already be built into the operating system. The Windows Command Prompt (CMD) includes powerful repair tools that can scan, diagnose, and fix corrupted system files without requiring third-party software.

In this guide, you’ll learn the most important Windows repair commands, what they do, and when to use them.


Why Use CMD Repair Commands?

Windows repair commands can help you:

  • Fix corrupted system files
  • Repair Windows image errors
  • Restore network connectivity
  • Repair hard drive issues
  • Improve system stability
  • Avoid a full Windows reinstall

Most of these tools are included for free in every modern version of Windows.


1. SFC /SCANNOW — System File Checker

The System File Checker (SFC) scans Windows system files and replaces corrupted or missing files automatically.

Command

sfc /scannow

What It Does

  • Verifies protected Windows files
  • Repairs corrupted system files
  • Restores missing DLLs and components

When to Use It

Use this command if:

  • Windows apps crash frequently
  • You get random system errors
  • Blue screens appear
  • Windows features stop working

How to Run

  1. Open Command Prompt as Administrator
  2. Type the command
  3. Press Enter
  4. Wait for the scan to complete

Possible Results

  • No integrity violations found
  • Corrupted files repaired
  • Some files could not be fixed

If SFC cannot repair files, use DISM next.


2. DISM — Repair Windows Image

The Deployment Image Servicing and Management (DISM) tool repairs the Windows system image.

Command

DISM /Online /Cleanup-Image /RestoreHealth

What It Does

  • Scans the Windows image
  • Downloads healthy files from Windows Update
  • Repairs deep system corruption

Why It Matters

SFC relies on the Windows image to restore files. If the image itself is damaged, SFC may fail. DISM fixes the source.

Recommended Order

Run these commands in this order:

DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow

3. CHKDSK — Check Disk Utility

CHKDSK scans your hard drive for file system errors and bad sectors.

Command

chkdsk C: /f /r

Parameters Explained

  • /f fixes disk errors
  • /r locates bad sectors and recovers data

What It Fixes

  • Corrupted file systems
  • Disk read/write issues
  • Drive errors after power outages
  • Slow system performance

Important Note

Windows may ask to schedule the scan at reboot because the drive is in use.

Type:

Y

Then restart your PC.


4. BOOTREC — Repair Boot Problems

If Windows refuses to boot, BOOTREC can repair startup files.

Commands

bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd

What These Commands Do

CommandPurpose
fixmbrRepairs Master Boot Record
fixbootWrites a new boot sector
scanosFinds Windows installations
rebuildbcdRebuilds Boot Configuration Data

When to Use

Use BOOTREC if:

  • Windows won’t start
  • You see “Bootmgr is missing”
  • Startup repair fails
  • Dual boot issues occur

Important

These commands are usually run from the Windows Recovery Environment (WinRE).


5. IPCONFIG — Repair Network Problems

IPCONFIG helps troubleshoot internet and DNS issues.

Commands

ipconfig /release
ipconfig /renew
ipconfig /flushdns

What They Do

CommandFunction
releaseReleases current IP address
renewRequests a new IP address
flushdnsClears DNS cache

Useful For

  • No internet connection
  • DNS errors
  • Slow website loading
  • Wi-Fi connection problems

6. NETSH — Reset Network Settings

NETSH can fully reset Windows networking components.

Commands

netsh winsock reset
netsh int ip reset

What It Fixes

  • Broken TCP/IP stack
  • Winsock corruption
  • Persistent network issues
  • VPN connection errors

After Running

Restart your computer to apply changes.


7. TASKKILL — Force Close Frozen Applications

Sometimes programs freeze completely and cannot be closed normally.

Command

taskkill /f /im program.exe

Example

taskkill /f /im chrome.exe

Parameters

  • /f = force close
  • /im = image name

This command is useful for unresponsive software.


8. SYSTEMINFO — Diagnose Your PC

Need detailed information about your system?

Command

systeminfo

Information Displayed

  • Windows version
  • RAM installed
  • Processor details
  • BIOS version
  • Network information
  • System uptime

Great for troubleshooting and diagnostics.


9. CLEANMGR — Free Up Disk Space

Windows includes a built-in cleanup tool.

Command

cleanmgr

What It Removes

  • Temporary files
  • Old Windows updates
  • Recycle Bin contents
  • Cache files

This can improve performance and free storage space.


10. SHUTDOWN Commands

CMD also lets you restart or shut down the PC quickly.

Restart Computer

shutdown /r /t 0

Shut Down Computer

shutdown /s /t 0

Abort Shutdown

shutdown /a

Useful for remote administration and scripting.


Best Practices Before Running Repair Commands

Before making system repairs:

  • Create a restore point
  • Back up important files
  • Run commands as Administrator
  • Close unnecessary applications
  • Be patient during scans

Some scans may take 30 minutes or longer.


Recommended Repair Workflow

If you’re unsure where to start, use this sequence:

Step 1 — Repair Windows Image

DISM /Online /Cleanup-Image /RestoreHealth

Step 2 — Scan System Files

sfc /scannow

Step 3 — Check the Drive

chkdsk C: /f /r

Step 4 — Restart the PC

Many issues disappear after these repairs.


Final Thoughts

Windows CMD repair commands are powerful tools that every user should know. Whether you’re fixing corrupted files, repairing boot errors, or restoring network connectivity, these built-in utilities can save hours of frustration and potentially avoid a complete Windows reinstall.

Learning a few essential commands can turn Command Prompt into one of the most valuable troubleshooting tools in Windows.

If you regularly maintain your PC, these commands should become part of your toolkit.

Comentarii

Postări populare de pe acest blog

Bethesda Is Giving Away Dishonored 2 for Free – Here’s How to Claim It

Windows 11 Performance Tweaks You Should Enable (Boost Speed Instantly)

Windows Performance Optimization Settings – Complete Guide to Speed Up Your PC