Repair Windows 10 or 11 Using Command Prompt (5 Ways) (2023)

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.

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 theWindows loads normally. In this case, try the following methods:

#1: Enablesafe mode with command prompt. In Windows 10/11, hold theShift button and click Restart, then select 6 or use F6 to enable command prompt under safe mode. Or shutdown your computer completely andrestart, 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.

#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, clickTroubleshoot>Advanced options>Command Promptor directly press Shift + F10 to summon it.

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

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

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

3. 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 toreset 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".)

4. 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 thatit willnotrestoredocuments, music, emails, or personal files of any kind, so you need tobackup files to external driveto 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 andpress "Enter" to continue.

3. This command will bring you to the interface of System Restore.Click Next and then choose touse the recommended restore point ora different restore point.Afterward, follow theinstructions.

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.

However,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 the Windows 10 with specialized software.

With AOMEI Backupper Professional, you can easily backup or restore Windows 10 either in Command Prompt or friendly graphic user-interface. Once disaster occurs, like 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.

5. How to restore Windowsusing AOMEI.exe command

Download the 30-day free trial of AOMEI Backupper right now! Windows 11/10/8/7/XP/Visa are supported.

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

Secure Download

Suppose you havecreated system image backupwith AOMEI Backupper. 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 thecommand prompt window to get them.

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.


  • If you need torestore 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 byits "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 yourcomputer, you still need to create a bootable USB(16GB at least) on a working computer.

Here are detailed steps to repair and restore Windows 10:

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 andselect the new hard drive in the next window.

4. Preview the operation summary and click Start Restore.


  • TheAOMEI Image Deploy feature saves much your time and effort in deploying image to multiple computer simultaneously, especially in company.
  • You may also perform disk to disk clone when you encounter disk error, and which is the fastest way to upgrade hard drive.


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 keepbackup softwareAOMEI 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 pickAOMEI Backupper Technicianor TechPlus edition. You will be surprised to find that it allows you to copy the installation directory forportable version creationand then you can use it anywhere and anytime. Don't hesitate to try it out!


How do I repair Windows 11 with Command Prompt? ›

Way 1: Press the Shift + F10 keys to open the Command Prompt window. Way 2: In the Windows setup wizard, select Repair your computer > Troubleshoot > Advanced options > Command Prompt in order.

How do I repair Windows 10 with Command Prompt? ›

You can repair Windows 10 with CMD using the SFC and DISM commands.
  1. Entering the CMD windows.
  2. Type in sfc /scannow, and press the Enter key. ...
  3. If the SFC command doesn't work. ...
  4. Type in DISM /Online /Cleanup-Image /ScanHealth to scan the corruptions of Windows images.
Nov 2, 2022

How do I fix Windows 11 automatic repair? ›

Click Advanced options when the recovery screen appears. Then in the "Choose an option" screen, click Troubleshoot => Advanced Options => Try the options Startup Repair and System Restore. If both didn't work, then RESET your PC.

How do I run a system repair from Command Prompt? ›

Right-click CMD.exe and select Run as Administrator. On the User Account Control (UAC) prompt, click Yes. In the command prompt window, type SFC /scannow and press Enter . System file checker utility checks the integrity of Windows system files and repairs them if required.

How do I run a Command Prompt in automatic repair? ›

1. How to open CMD during Windows Setup using the Shift + F10 keyboard shortcut
  1. Boot your PC using some Windows installation media (USB, DVD, etc.) ...
  2. Press Shift + F10 on the keyboard to open Command Prompt on boot. ...
  3. Choosing Repair your computer. ...
  4. The Troubleshoot option. ...
  5. Open Command Prompt before booting Windows.
Jun 1, 2022

How do I run a diagnostic on my computer using Command Prompt? ›

Hit Windows Key + R on your keyboard to launch the Run dialog box and type: perfmon /report and hit Enter or click OK. You can run that same command from the Command Prompt (Admin) to generate the report, too.

How do I force Windows into repair mode? ›

Here's how:
  1. Press Windows logo key + L to get to the sign-in screen, and then restart your PC by pressing the Shift key while you select the Power button > Restart in the lower-right corner of the screen.
  2. Your PC will restart in the Windows Recovery Environment (WinRE) environment.

How do I force a Windows 10 repair? ›

How to initiate startup repair from the desktop or lock screen
  1. Click Start.
  2. Click the power button icon.
  3. Press and hold down the Shift key and then click Restart. ...
  4. Select Troubleshoot.
  5. Go to Advanced Options > Startup Repair.
  6. After the startup repair process is complete, reboot the computer.
Jan 3, 2022

How to repair Windows 11 with SFC and DISM tools? ›

Fix and Repair Windows 11 Disk Error with SFC and DISM Alternative Tool
  1. Right-click the target partition that has a problem.
  2. Choose "Advanced" > "Check File System".
  3. Confirm if you want to hide the partition or not.
  4. In the Check File System window, check the "Try to fix errors if found" option.
Dec 6, 2022

How do I do a force clean install of Windows 11? ›

How to clean install Windows 11 using Reset this PC local image
  1. Open Settings on Windows 11.
  2. Click on System.
  3. Click on Recovery on the right side.
  4. Under the “Recovery options” section, click the Reset PC button in the “Reset this PC” setting.
  5. Click the Remove everything option to perform a fresh install of Windows 11.
Jan 3, 2023

How do I repair Windows 11 without losing anything? ›

Use the installation media to reinstall Windows 11

Select Change to determine what to keep: Select one of the following options, and then select Next: Keep personal files and apps – This will preserve your personal data, apps, and settings.

How can we solve the problem of automatic repair? ›

But, there is no need to worry as our solutions will work for most causes of a Windows 10 automatic repair loop.
  1. Run Fixboot and Chkdsk Commands. ...
  2. Perform a System Scan in Safe Mode. ...
  3. Restore the Windows Registry. ...
  4. Disable the Automatic Repair Tool. ...
  5. Disable Early Launch Anti-Malware. ...
  6. Reset Your Windows 10 Device.
May 10, 2022

How do I force a system repair? ›

How to initiate startup repair from the desktop or lock screen
  1. Click Start.
  2. Click the power button icon.
  3. Press and hold down the Shift key and then click Restart. ...
  4. Select Troubleshoot.
  5. Go to Advanced Options > Startup Repair.
  6. After the startup repair process is complete, reboot the computer.
Jan 3, 2022

What is the Run command for System Restore? ›

What to Know
  1. Open Command Prompt.
  2. Type rstrui.exe in the window, and then press Enter.
  3. Follow the on-screen instructions to complete the system restore.
Jul 12, 2022

How do I run boot repair? ›

Method 1: Startup repair tool
  1. Start the system to the installation media for the installed version of Windows. ...
  2. On the Install Windows screen, select Next > Repair your computer.
  3. On the Choose an option screen, select Troubleshoot.
  4. On the Advanced options screen, select Startup Repair.
Feb 8, 2023

How do I run a full system diagnostic? ›

In Windows 10, go to Start , then select Settings > Privacy > Diagnostics & feedback. In Windows 11, go to Start , then select Settings > Privacy & security > Diagnostics & feedback.

How do I run a full diagnostic? ›

To launch the tool, press Windows + R to open the Run window, then type mdsched.exe and hit Enter. Windows will prompt you to restart your computer. The test will take a few minutes to complete. When it's over, your machine will once again restart.

How to check hardware health in cmd? ›

Windows Chkdsk

Type "cmd" into the search bar as before—but this time don't hit enter, instead right-click on "Command Prompt" and select "Run as Administrator." Once the new Command Prompt window opens, you can then type "chkdsk" and hit enter. Much more information will be displayed than with the S.M.A.R.T.

How do I repair Windows 10 without booting? ›

Launch the Windows 10 Advanced Startup Options menu by pressing F11. Go to Troubleshoot > Advanced options > Startup Repair. Wait for a few minutes, and Windows 10 will fix the startup problem.

How to repair Windows 10 from BIOS? ›

When using a USB drive, make sure to set up your BIOS to boot from the USB drive. After booting into setup, choose the Repair Computer option > Troubleshoot > Advanced Options > Command Prompt. If you are using a recovery drive, click Troubleshoot > Advanced Options > Command Prompt.

Does Windows 11 have a repair tool? ›

Each different Windows 10/11 component has its own troubleshooter, and you can access them all in the settings. Follow these easy steps to fix Windows issues on your computer: Go to settings from your Start menu, then click on Update and Security.

How do I run a full office repair? ›

Repair Office
  1. Right-click the Start button. ...
  2. Select the Microsoft Office product you want to repair, and select Modify. ...
  3. Depending if your copy of Office is Click-to-run or MSI-based install, you'll see the following options to proceed with the repair. ...
  4. Follow the instructions on the screen to complete the repair.


Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated: 11/12/2023

Views: 5329

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.