By Ivy / Last update September 24, 2021

How do I repair Windows 10/11 with command prompt?

When there is some problem happening to Windows, you can repair your windows with some basic repair like Windows directory repair, boot directory repair. When the error is too serious, you can run advanced repair like system restore. For Windows 10/11, you can also use DISM command line utility to repair Windows 10/11 image.

Next, this article will introduce you how to repair Windows 10/11 using command prompt with five methods.

Method 1. How to repair Windows 10/11 using SFC

SFC (System File Checker) is a command-line utility that can scan for corruption in Windows system files and replace any corrupted or missing protected system files with a known good version. When you feel buggy with your computer or notice problems during boot, you can use SFC to diagnose problems and repair it. 

To repair Windows 10/11 using SFC with detailed steps:

1. Open "Start", search for the Command Prompt, select it and run as administrator.

2. Then type the command: "sfc /scannow" and press "Enter".

SFC

If SFC is unable to fix the problem, probably the utility cannot get the necessary files from the Windows image, which might have become broken. In this situation, you can use DISM to repair the Windows image.

Method 2. How to repair Windows 10/11 using DISM

Windows 10/11 includes a command-line utility known as DISM (Deployment Image Servicing and Management). DISM command Windows 10/11 can be used to repair and prepare Windows images, including, Windows Setup, Windows Recovery Environment, and Windows PE. Also, DISM can be used to fix the recovery image within an installation of the operating system.

To repair Windows 10/11 using DISM commands:

  • To check whether there is any corruption, Run command line as administrator, then type the following syntax and press "Enter".

DISM /Online /Cleanup-Image /CheckHealth

  • To scan the Windows image for any corruption, type below command and hit "Enter".

DISM /Online /Cleanup-Image /ScanHealth

  • To fix Windows image, type the following command and hit "Enter".

DISM /Online /Cleanup-Image /RestoreHealth /Source:repairSource\install.wim

DISM Repair Windows 10

Method 3. How to reset Windows 10/11 with command line

To reset Windows 10/11 with "Reset this PC", follow the instructions below:

Type “systemreset -cleanpc” in an elevated command prompt and press "Enter".  (If your computer cannot boot, you can boot into recovery mode and select "Troubleshoot", and then choose "Reset this PC".)

Reset PC

Method 4. How to run system restore with command prompt

If the problem is too severe, you can try to restore your Windows 10/11 to the previous state as long as you have enabled system restore. But, it will not restore documents, music, emails, or personal files of any kind. If this is what you need, see below.

To run system restore in safe mode, follow the steps below:

1. Start your computer and press "F8" repeatedly until the Windows advanced options menu appears.

2. Click "Safe Mode with command prompt" and press "Enter". If your computer can boot normally, type "cmd" in the search box and click "Command Prompt" to continue.

3. Sign in using an administrator account if needed. Once the command prompt is showing, enter "rstrui.exe" at first in the Command Prompt Window and press "Enter" to continue.

Launch System Restore

4. This command will bring you to the interface of System Restore. You can either use the recommended restore point or click "Next" to choose an available restore point. Then, follow the instruction to complete system restore.

Choose Restore Points

Method 5. How to repair Windows 10/11 with AOMEI.exe

Besides system restore, you can also repair Windows 10/11 with AOMEI.exe. AOMEI Backupper is reliable backup and restore software that deserves a try.

  • It is designed for Windows 11/10/8/7/XP/Visa.
  • It allows you to do backup and restore either from graphic user interface or command line.
  • It has some features that Windows built-in tool does not have. For example, you can use AOMEI Backupper to create incremental/differential backup, and you can restore system to dissimilar hardware.

Download the 30-day free trial of AOMEI Backupper right now!

Download Free Trial Win 11/10/8.1/8/7/XP
Secure Download

Suppose you have created system image backup with AOMEI Backupper. Before restoring system, you can use the Check Image feature to check if system image backup is intact and without error. Then, use the following steps to restore Windows 10/11 with AOMEI.exe:

1. Navigate to AOMEI Backupper installation directory by typing the following command in command line and press "Enter". For example: cd C:\Program Files (x86)\AOMEI Backupper.

Note: If you run this command under Windows PE environment, the drive letters might change.

2. Run the following command to start restore: AMBackup /r /t [backup type] /s "[backup location path]" /d [destination location]. For example: To restore the system backup saved in J:\systembackup1 to disk 1. You should type the command: AMBackup /r /t system /s “J:\system backup\systembackup1.adi” /d 1

AOMEI Command

Tips:

  • If you need to restore to another computer, AOMEI Backupper "Universal Restore" feature can make this very easy. For example: Run system restore in the image named "systembackup1.adi" to the partition 0 on disk 0 and perform a universal restore. AMBackup /r /t system /s "D:\system backup\systembackup1.adi" /d 0:0 /x
  • You can find "Recovery Environment" utility in "Tools" to enable the boot option of AOMEI Backupper recovery environment. When system crashes, it enables you to perform backup/restore from boot easily.

Create Recovery Environment

Summary

Now you have learned how to repair Windows 10/11 using command line with five methods. You can choose one based on your preference. It is also suggested to keep backup software AOMEI Backupper installed on your computer to provide continuous protection. 

If you want to protect unlimited computers within your company, you can pick AOMEI Backupper Technician.  You will be surprised to find that it enables you to copy the installation directory for portable version creation. Don't hesitate to try it out!