Complete Guide to Repairing Windows 11 from CMD: Step-by-Step Solutions

Last update: 08/05/2025
Author Isaac
  • Master the commands repair essentials for Windows 11 from CMD
  • Learn to solve critical errors and problems Boot without reinstalling the system
  • Learn when to use SFC, DISM, and other advanced tools for a clean, functional system.

Repair Windows 11 from CMD

If your computer with Windows 11 begins to show symptoms such as Recurring errors, slow startups, application crashes, or even unexpected black screens, it's very likely that the operating system is experiencing an internal problem. For many users, these situations create uncertainty, especially if they don't know the options available to resolve the issue without losing data or having to reinstall everything.

In this article you will find a complete, detailed and simple guide about how you can repair Windows 11 using the symbol of the system (DCM), making the most of the tools that the system itself incorporates to resolve errors corrupt files, boot errors, Windows image issues, or simply want to return to a previous, stable state. Here are not only the steps to follow, but also tips, useful commands, and recommendations to help you recover your PC quickly.

Main commands to repair Windows 11 from CMD

There are several built-in tools in Windows 11 that you can run from the Command Prompt to troubleshoot most serious system issues. Below, we'll outline the most important ones and how to use them correctly.

  • CHKDSK: Analyzes and repairs hard drive errors, detecting bad sectors and damaged files.
  • SFC (System File Checker): Checks and restores essential operating system files to their original state.
  • DISM (Deployment Image Servicing and Management): Scans and fixes the Windows image if SFC fails to fix errors.
  • BOOTREC: Fixes boot issues, ideal when Windows 11 won't start properly.
  • RSTRUI.EXE: Allows you to restore the system to a previous point, if restore points have been previously created.

How to open Command Prompt in Windows 11

Depending on whether the system manages to start or not, accessing the command prompt will be different. Here are the two main options:

If Windows 11 starts normally

  • Click on the start menu and type “cmd” in the search box.
  • In the results, right-click on Symbol of the system and select Run as administrator to gain elevated privileges.

If Windows 11 does NOT boot normally

  • Start the computer using a USB or Windows installation DVD.
  • When the wizard appears, select “Repair your computer” instead of “Install now.”
  • Go to Troubleshoot > Advanced Options > Command Prompt to open the console.
  • As an alternative method, you can press Shift + F10 in the installer to open CMD directly.
  Can you use Roku without Wi-Fi? Find out how to do it

CHKDSK: Scan and repair hard drive errors

The command CHKDSK (Check Disk) It is the first step if you suspect physical or logical problems with the disk, such as corrupted files, bad sectors, or read and write errors. It works directly on the storage drives storage and can help you prevent problems from getting worse.

  • Basic analysis: chkdsk C: (Replace "C" with the letter of the drive you want to scan.) This command only shows you if there are any problems, it doesn't fix them.
  • Bug Fix: chkdsk /f C: Detects and corrects errors found on the specified drive. May require a system restart if the drive is in use.
  • Comprehensive analysis and repair + bad sector search: chkdsk /r C: Locate damaged sectors and try recover readable information moving it to healthy areas of the disc.

It is recommended to use the parameter /r if you suspect physical disk problems in addition to system errors.

SFC: System File Checker

El System File Checker (SFC) It is a very efficient tool for detect and restore damaged or missing system filesIt is especially recommended if you notice error messages related to DLL files, frequent blue screens, or general instability.

  • Open CMD as administrator.
  • Run sfc /scannow and press Enter.
  • The process may take several minutes. When it's complete, the system will display a status summary and tell you if it was successful. repair corrupt files.

After the analysis, different messages may be displayed:

  • "Windows Resource Protection found corrupted files and successfully repaired them": the problem has been solved.
  • "Windows Resource Protection found corrupted files, but couldn't fix some of them": In this case, it will be necessary to use DISM.

DISM: Advanced Tool to Repair Windows 11 Image

When SFC fails to fix certain files, it may be because the windows image is corrupt. This is where it comes into play DISM (Deployment Image Servicing and Management)This utility allows you to examine and repair the system image, ensuring that SFC can function properly in the future.

  • First: Check the health of the image with DISM /Online /Cleanup-Image /CheckHealth
  • For further analysis: DISM /Online /Cleanup-Image /ScanHealth
  • If errors are detected: Run DISM /Online /Cleanup-Image /RestoreHealth. This command will download and restore the necessary files from Microsoft servers if you have an internet connection.
  Fix error 0x80004005 in Windows step by step

If you do not have internet access, DISM allows you to use a Windows 11 ISO or USB image as a repair source. You'll need to adapt the command like this:

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

Replaces D: by the letter that corresponds to your drive. Once the process completes successfully, it is recommended to run it again SFC to ensure that everything is repaired correctly.

troubleshoot boot problems in Windows 2
Related article:
How to Fix Windows Won't Boot: Complete Step-by-Step Guide

BOOTREC: Troubleshoot boot issues in Windows 11

If your team presents Problems starting up, freezing or displaying startup errors, the command bootrec.exe is your best option to repair Windows startup.

  • From a recovery environment or installation media, open CMD and run the commands in order:
    • bootrec /fixmbr – Write a new one MBR (master boot record).
    • bootrec /fixboot – Write a new boot sector.
    • bootrec /rebuildbcd – Rebuilds the boot database (BCD).

These commands usually resolve most boot-related errors, such as those caused by infections, power outages, or failed updates.

Restore Windows 11 to a previous point from CMD

If you need to return to a previous state, the system restore It can be fast, as long as you have previously created restore points. To do this, use rstrui.exe in CMD:

  • Introduce rstrui.exe and press Enter.
  • You will follow the steps in the wizard to select the desired restore point.

This method It only works if you have saved points and the restore was active.Otherwise, you'll have to look elsewhere.

Reset Windows 11 to factory settings with a single command

If none of the previous options work or you want to completely return the system to its initial state, you can use the command systemreset –factoryresetThis command lets you decide whether to keep your files or delete everything, restoring your system to its original configuration.

  • From CMD as administrator, type systemreset --factoryreset.
  • Choose your preferred option and follow the wizard's instructions.
  FIX: Windows PC is not compatible with Xinput1_3.dll

This process is faster than a complete reinstallation and can be performed without advanced knowledge. However, It is essential to back up your important data before proceeding., to avoid irreparable losses.

What to do if a system file cannot be repaired automatically

In rare cases, it may happen that neither SFC nor DISM can repair certain critical files. In these situations, it is recommended manually replace the damaged file following these steps:

  1. Use takeown /f <ruta_archivo> to take ownership of the affected file.
  2. Grants full permissions with icacls <ruta_archivo> /grant administradores:F.
  3. Replace the file with a healthy copy from another working installation or ISO image, using copy <ruta_fuente> <ruta_destino>.

If this method doesn't work either, it's best to perform a full system reset to ensure its integrity.

Tips before repairing Windows 11 from CMD

  • Always make a backup of your important data.
  • Keep your equipment connected to power to avoid blackouts.
  • Check if system restore is active and if there are recovery points available.
  • If you suspect that the fault may be hardware, performs physical tests on components such as disk and RAM before applying software solutions.

Repairing Windows 11 from CMD is a powerful option that can resolve everything from minor to more complex issues, without the need for reinstallations. With commands like CHKDSK, SFC, DISM, BOOTREC, and rstrui.exe, you have everything at your fingertips to restore your system to a working state, as long as you follow the right steps and don't rush. The key is to correctly identify the source of the problem and use the most appropriate tool for each case: analyze the disk, repair files, correct the image, or troubleshoot the boot. Patience and making backups beforehand are your best allies to prevent a Windows 11 failure from becoming an irreparable crisis.