How to Repair Windows 11 Using Command Prompt: A Step-by-Step Guide

Windows 11 is generally stable, but sometimes you may run into problems such as corrupted system files, missing updates, or boot issues. If that happens, you don’t always need to reinstall Windows from scratch. One of the fastest and most powerful ways to repair Windows 11 is using the Command Prompt.

In this guide, we’ll cover multiple command-line tools that help you scan, repair, and restore Windows 11. By the end, you’ll be able to fix common system issues without losing your data.


Why Use Command Prompt to Repair Windows 11?

Command Prompt is a built-in tool that allows advanced repairs without third-party software. Benefits include:

  • Direct access to system files – No GUI limitations.

  • Faster troubleshooting – Run scans and repairs in minutes.

  • No data loss – Most commands fix issues without affecting personal files.

  • Powerful tools – You can repair corrupted files, fix the bootloader, or restore system integrity.


Step 1: Open Command Prompt as Administrator

Many repair commands require elevated privileges:

  1. Press Win + S, type cmd.

  2. Right-click Command Prompt and select Run as administrator.

  3. Click Yes if prompted by User Account Control.

You’re now ready to run repair commands safely.


Step 2: Use System File Checker (SFC) to Repair Corrupted Files

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

Steps:

  1. In Command Prompt, type:

    sfc /scannow
  2. Press Enter.

  3. Wait for the process to complete. This may take several minutes.

  4. Review the results:

    • No integrity violations → Your system files are fine.

    • Found and repaired → Windows fixed the issues automatically.

    • Could not fix some files → Use DISM next (covered below).

Tip: Run SFC 2–3 times for stubborn issues.


Step 3: Use DISM to Repair Windows Image

Sometimes SFC alone cannot fix certain problems. DISM (Deployment Imaging and Servicing Management) repairs the Windows image.

Steps:

  1. In Command Prompt, type:

    DISM /Online /Cleanup-Image /RestoreHealth
  2. Press Enter and wait. This can take 10–20 minutes.

  3. Once done, run sfc /scannow again to ensure all files are repaired.

DISM uses Windows Update to replace corrupted files. If Windows Update isn’t working, you can use an offline repair source.


Step 4: Repair the Bootloader with Bootrec Commands

If your system won’t boot, repairing the bootloader can help.

Steps:

  1. Boot from a Windows 11 installation USB.

  2. Click Repair your computer > Troubleshoot > Command Prompt.

  3. Type the following commands one by one, pressing Enter after each:

    bootrec /fixmbr
    bootrec /fixboot
    bootrec /scanos
    bootrec /rebuildbcd
  4. Restart your PC and check if it boots normally.

This fixes MBR, boot sector, and boot configuration issues.


Step 5: Reset Windows Components Using Command Prompt

If Windows updates are broken, you can reset update components:

  1. Open Command Prompt as administrator.

  2. Stop Windows Update services:

    net stop wuauserv
    net stop bits
  3. Rename software distribution folders:

    ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
    ren C:\Windows\System32\catroot2 Catroot2.old
  4. Restart Windows Update services:

    net start wuauserv
    net start bits
  5. Check for updates again via Settings > Windows Update.

This solves many update installation errors.


Step 6: Additional Helpful Commands

  • Check disk health:

    chkdsk C: /f /r
  • View system file integrity log:

    sfc /verifyonly
  • Repair Windows using installation media:

    DISM /Online /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim /LimitAccess

    Replace D: with your USB drive letter.

These commands can help you diagnose deeper system problems.


Tips for a Successful Repair

  • Always backup important data before making major repairs.

  • Run SFC and DISM multiple times if issues persist.

  • Ensure Windows Update is working for DISM online repair.

  • Use official installation media for offline repair.

  • Avoid third-party “fix all” tools—they can sometimes cause more harm.


Common Problems and Fixes

1. SFC cannot fix some files:

  • Run DISM /RestoreHealth first, then retry SFC.

2. DISM fails:

  • Check internet connection or use an offline repair source with installation media.

3. Bootrec commands don’t fix boot issues:

  • Use Startup Repair from the Windows 11 installation USB.

4. Chkdsk runs indefinitely:

  • Large drives or bad sectors may take hours. Be patient.


Conclusion

Repairing Windows 11 using Command Prompt is powerful and efficient. Tools like SFC, DISM, and Bootrec allow you to fix corrupted files, restore Windows images, and even repair the bootloader without reinstalling your OS.

By following this guide, you can diagnose and fix most common Windows 11 issues, saving time and avoiding data loss. Remember to run commands carefully and always backup important files before performing major repairs.


FAQs

Q1. Can I repair Windows 11 without Command Prompt?
Yes, you can use Settings > Recovery, but Command Prompt gives more control and options.

Q2. Does SFC delete my personal files?
No, SFC only scans and repairs system files. Your data remains safe.

Q3. How long does DISM /RestoreHealth take?
Typically 10–20 minutes, but it may take longer on large systems or slow internet connections.

Q4. Do I need installation media for repairs?
Not always. DISM can use Windows Update online, but installation media helps for offline repairs.

Q5. Can Command Prompt fix startup issues?
Yes, using Bootrec commands or Startup Repair from installation media can fix boot problems.


Scroll to Top