How to repair your Windows 11 operating system from CMD

If you are one of those who use Windows as the main system on your computer, we are sure that you have probably had problems with this system, but if there are methods to repair the system, we can also repair our operating system from the command prompt or CMD . You do not need to be an expert to perform this procedure. To start with the repair of our system, it is recommended to create a backup from the Windows settings. You can consult the official Microsoft page to learn more about the operation of each of these commands. Here we tell you how to repair Windows from the CMD.

Índice de Contenido
  1. How to repair my operating system from the CMD?
  2. Download Windows 11 or 10 ISO file to repair Windows from cmd
  3. Fix Windows 10 recovery image from cmd
  4. Troubleshoot DISM using an ESD image to repair Windows from cmd
    1. Tutorial on how to repair Windows from the CMD:

How to repair my operating system from the CMD?

To start with the repair, we must be administrators of the operating system, for this we go to start> cmd right click and execute as administrator , now we will give yes to open the cmd as administrator. This procedure is important to be able to perform the procedure at admirable levels.

open command prompt as administrator
open command prompt as administrator

Within the CMD, we will correctly write the commands that appear below:

1.- sfc /scannow :  This command will scan and examine the files that are protected, then replace the files that are damaged with the one from the cache found in the path %WinDir%\System32\dllcache, this is located compressed, the %WinDir% variable is  the equivalent of C:\Windows. When executing this command it is important not to close the window until the process has finished.

If at the end of the procedure you receive the message: "Windows Resource Protection did not find any integrity violations", it means  that there are no damaged or missing files, so this procedure was successful. Otherwise, a message "Windows Resource Protection could not find the requested action" will appear, this means that the verification of the damaged files could not be carried out and they may be able to be replaced, it is necessary to use the safe mode and go back run the command.

sfc /scannow
sfc /scannow

 

2.- chkdsk c: /f /r :  It will repair the local drive C:, its function is to scan the file system files with their respective metadata and fix any error that may exist in the disk volume, then it will try to repair it . We can use the command chkdsk (drive letter) / (f, r, x)

  • C:> Will examine local drive C
  • /f > Will fix errors on disk
  • /r > Will find the bad sectors and try to recover the information (used with /f)
  • /x> Will force the disk to be unmounted if necessary (used with /f)
chkdsk c: /f /r
chkdsk c: /f /r

3.- DISM /Online /Cleanup-Image /CheckHealth :  The CheckHealth option together with the DISM tool will help us find any corruption within the local disk image in the installation of our system, but it will not help us to repair it.

4.- DISM /Online /Cleanup-Image /ScanHealth: The ScanHealth option will be performed together with DISM to help us perform a deeper analysis to see if the system image has any problems.

5.- DISM /Online /Cleanup-Image /RestoreHealth: This command together with DISM will help us to automatically scan and repair the most common problems that exist within the image.

6.- DISM /Online /Cleanup-Image /RestoreHealth /Source:C:/RepairSource/Windows /LimiAccess

Download Windows 11 or 10 ISO file to repair Windows from cmd

If you need to use another file source, it is recommended to use the Media Creation Tool to download a fresh copy of Windows 11 or Windows 11. If the above options did not work for you, you can perform the following steps, since it will also guarantee us to repair the file. operating system completely.

To download the Windows 10 ISO file, follow these steps:

  1. Open this Microsoft support website  ( opens in a new tab) .
  2. Click the Download Tool Now button.
  3. Then double click on the MediaCreationToolxxxx.exe file and it will run.
  4. We click on the Accept button to accept the terms and conditions of the tool.
  5. We select in Create installation media (USB flash drive, DVD or ISO file) for another  PC option.

  1. Click on the Next button.
  2. Click the  Next button  again.

  1. Select the  ISO file option previously chosen the version of the operating system and its language.

  1. Click the Next button.
  2. Select the destination to store the Windows 10 ISO file.
  3. Click the Save button.
  4. Click the link to open the file location with File Explorer.

Source: Windows Central ( Image Credit: Source: Windows Central)
  1. Click the Finish button.
  2. Double-click the  Windows.iso file to  mount the image that was downloaded.
  3. In the "This PC" section, confirm the drive letter for the mount point.

After completing the steps, you can proceed with the DISM tool using the "Source" option to repair the local image.

Fix Windows 10 recovery image from cmd

Now To run the Deployment Image Servicing and Management tool with an alternate source image (install.wim) , follow these steps:

  1. Open Start.
  2. Search for  Command Prompt,  right-click on the top result and select the  Run as administrator option.
  3. Type the following command to repair Windows 10 image and press Enter: DISM /Online /Cleanup-Image /RestoreHealth /Source:E:\Sources\install.wim In the command, replace  "F"  with the drive letter of the ISO mount point in File Explorer.

  1. (Optional) Type the following command to limit the use of Windows Update and press  Enter  :DISM /Online /Cleanup-Image /RestoreHealth /Source:E\Sources\install.wim /LimitAccess
  2. (Optional) Type the following variant of the above command to perform the same task and press  Enter  :  DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:E:\Sources\install.wim:1 /LimitAccessIn the command, change  E:\Sourcesthe path to the "install.wim" file.

Once you complete the steps, the command will scan and fix the issues using the "install.wim" file you specified as the alternate source.

Troubleshoot DISM using an ESD image to repair Windows from cmd

If you have an encrypted "install.esd" image, you can use it to repair damaged files in Windows 10.

To use DISM with an "install.esd" image file as a source to repair Windows 10, follow these steps:

  1. Open Start.
  2. Search for  Command Prompt,  right-click on the top result and select the  Run as administrator option.
  3. Type the following command to repair the image with an "install.esd" file and press Enter: DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\ESD\Windows\sources\install.esd In the command, change  C:\ESD\Windows\sourcesthe path to the location of the ".esd" file (if different).

  1. (Optional) Type the following command to limit the use of Windows Update and press Enter: DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\ESD\Windows\sources\install.esd /LimitAccess
  2. (Optional) Type the following variant of the above command to perform the same task, and press Enter: DISM /Online /Cleanup-Image /RestoreHealth /Source:esd:C:\ESD\Windows\sources\install.esd:1 /LimitAccess
  3. (Optional) Type the following command to use an install.esd file located on another drive and press Enter: DISM /Online /Cleanup-Image /RestoreHealth /Source:E:\Sources\install.esd In the command, replace  E:\Sourceswith the path to the location of the "install.esd" file.

After completing the steps, the tool will repair the damaged files using the files included in the "install.esd" image.

You may also be interested in: How You Can Completely Repair WordPress Website (Opens in a new browser tab)

Tutorial on how to repair Windows from the CMD:

https://www.youtube.com/watch?v=gxyrHMSWmdE

Leave a Reply

Your email address will not be published. Required fields are marked *

Go up