Top 5 Ways | Repair Windows 10, 11 Using Command Prompt

You can easily fix Windows 10/11 computer error like startup error or BSoD using command prompt with the help of SFC, DISM, System Restore, etc.


by Ivy Updated on February 26, 2024

Share this: instagram reddit

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 methods 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.

👉1. How to restore Windows using AOMEI.exe command

Repair Windows 10 using Command Prompt

Next, this article will introduce you how to repair Windows 10 from Command Prompt with five methods. Note that you can easily open cmd if the Windows loads normally. In this case, try the following methods:

#1: Enable safe mode with command prompt. In Windows 10/11, hold the Shift button and click Restart, then select 6 or use F6 to enable command prompt under safe mode. Or shutdown your computer completely and restart, then hold the Power button when it start to load Windows. Repeat this process 3-4 times and select the option to enable command prompt. 

Select Command Prompt

#2: Access command prompt from the recovery environment. In Windows 10/11, click Start > Settings > Update & Security > Recovery > Advanced startup and then Restart now to boot into recovery environment. And then, click Troubleshoot > Advanced options > Command Prompt or directly press Shift + F10 to summon it. 

If you cannot access Windows 10/11, insert installation media, set boot priority for it and boot into recovery environment, then select command prompt in the Advanced options window.

Advanced Options

Overview of the commands used on this page:

✅ AOMEI.exe

To restore Windows with AOMEI Backupper, type specific AOMEI commands.


To fix Windows image, type “DISM /Online /Cleanup-Image /RestoreHealth”.

✅ Reset Windows 10

To reset Windows 10 PC, type “systemreset -cleanpc”.

✅ System restore

To restore system to previous state, type "rstrui.exe".


To fix Windows 10 startup problems, type "sfc /scannow".

1. How to restore Windows using AOMEI.exe command

Prevention is better than cure. It is better to take preventive measures in advance than to solve the problem. Therefore, it is highly recommended to protect Windows 10 with specialized software.

With AOMEI Backupper Professional, you can easily backup or restore Windows 10 either in Command Prompt or a friendly graphic user interface. Once a disaster occurs, like a system crash or disk error, you may return to normal status in a short time. It also supports to restore Windows 10 to dissimilar hardware, i.e. a different computer.

AOMEI Backupper offers the AMBackup.exe utility, allowing users to create backups via the command line interface or by generating a batch (.BAT) file, particularly useful for unattended and multi-task backups. This command line tool enables users to execute nearly all backup operations supported by the AOMEI Backupper's graphical user interface (GUI).

AOMEI Backupper
Free Backup / Restore CMD Tool
  • Diverse functions: This command line interface enables various functions including backup, cloning, restoration, and more.
  • Additional actions: The AMBackup.exe utility supports tasks such as naming, compressing, splitting, encrypting image files, and backing up data sector by sector.
  • Backup types: Available options include new, full, incremental, and differential backups.
  • Storage options: Backup images can be saved locally to internal or external storage, or remotely to a shared network.
wink Tips:

1. The prerequisite for using the AMBackup.exe utility to restore is that you have created system image backup with AOMEI Backupper.

2. To recover backed-up images, utilize the AOMEI Backupper graphical user interface (GUI).

Before restoring system, you can use the Check Image feature to check if system image backup is intact and without error. Also, you need to learn some parameters you will use, please type"ambackup /?" at the command prompt window to get them.

Backup Command

Then, use the following steps to restore Windows 10/11 using command prompt (here is 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


  • 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 access this software quickly without booting the computer by its "Recovery Environment" utility.

Except for the command line interface, you still can use its graphic user interface and the steps are easier. It requires a backup image and be sure it's intact too. Note that if you cannot access your computer, you still need to create a bootable USB (16GB at least) on a working computer.

Select Task

Here are detailed steps to repair and restore Windows 10 with AOMEI Backupper:

1. Launch this software, go to Restore tab and choose Select Task.

2. In the Restore window, select the backup image you want to restore, here is system backup, and click Next.

Tip: If there is no system image, you can choose to select backup image manually. Click Back and then choose Select Image File to browse and select image.

3. In the image information window, choose Restore this system backup and Restore system to other location. Then, click Next and select the new hard drive in the next window.

4. Preview the operation summary and click Start Restore.


2. Repair Windows 10 startup problems 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 fix Windows 10 startup problems. 

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".


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 try the next solution.

3. Repair Windows 10 using DISM Command

Windows 10/11 includes a command-line utility known as DISM (Deployment Image Servicing and Management). DISM command in 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

4. Reset Windows 10 with command line to start over

If you are not sure why your computer run into issues, it's a good choice to reset your PC in Windows 10. It will keep your personal data and remove all apps and programs, except for preinstalled software. For more infomation, click Reset Windows 10 PC and keep my files

To troubleshoot Windows 10 using command prompt in this way, 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

5. Run system restore with Command Prompt to fix Windows 10

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 feature. Please note that it will not restore documents, music, emails, or personal files of any kind, so you need to backup files to external drive to avoid data loss before performing system restore. 

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

1. If your computer can boot normally, start cmd as before. If not, start your computer from safe mode and enable command prompt via 6 or F6. 

2. 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

3. This command will bring you to the interface of System Restore. Click Next and then choose to use the recommended restore point or a different restore point. Afterward, follow the instructions.

System Restore Next

That's all common methods to repair Windows 10 problems or issues using Command Prompt. They are also suitable for Windows 11 and Windows 7 errors troubleshooting. 

Further Reading: How to Repair Corrupted OS Using CMD?

👉Boot from Windows Installation Media: Insert your Windows installation media (USB or DVD) and boot your computer from it.

👉Check Disk (CHKDSK):

  • Type chkdsk C: /f /r and press Enter. Replace "C:" with the drive letter where your operating system is installed if it's different.
  • This command will check the file system for errors and bad sectors on the disk and attempt to fix them.

👉Bootrec Commands:

  • Use Bootrec commands if your boot configuration data is corrupted.
  • Type the following commands one by one, pressing Enter after each:

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

👉Reinstall Windows: If none of the above steps work and your system is still corrupted, you might need to consider reinstalling Windows. Be sure to back up your important files before doing this.


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're an IT Technician or if you want to protect unlimited computers within your company or deploy images to multiple computers effortlessly, you can pick AOMEI Backupper Technician or TechPlus edition.

You will be surprised to find that it allows you to copy the installation directory for portable version creation and then you can use it anywhere and anytime. Don't hesitate to try it out!

Ivy · Editor
Ivy is an editor of AOMEI Technology, she covers backup & restore,hard disk & partitions management and cloud files transfer and so on for AOMEI. She is an outgoing girl and enjoys helping people find solutions to their problems. She loves traveling, eating, reading and so on. She usually hangs out with friends at her leisure time.