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 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.
#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.
Overview of the commands used on this page:
✅ SFC |
To fix Windows 10 startup problems, type "sfc /scannow". |
✅ DISM |
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". |
✅ Qiling.exe |
To restore Windows with Qiling Disk Master, type specific Qiling commands. |
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.
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:
DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth /Source:repairSource\install.wim
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".)
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.
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.
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 Qiling Disk Master 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.
Download the 30-day free trial of Qiling Disk Master right now! Windows 11/10/8/7/XP/Visa are supported.
Suppose you have created system image backup with Qiling Disk Master. 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 "DiskMasterUI /?" at the command prompt window to get them.
Then, use the following steps to restore Windows 10/11 using command prompt (here is Qiling.exe):
1. Navigate to Qiling Disk Master installation directory by typing the following command in command line and press "Enter". For example: cd C:\Program Files (x86)\Qiling Disk Master.
Note: If you run this command under Windows PE environment, the drive letters might change.
2. Run the following command to Proceed: DiskMasterUI /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: DiskMasterUI /r /t system /s “J:\system backup\systembackup1.fvd” /d 1.
✍ Tips:
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.
Here are detailed steps to repair and restore Windows 10 with Qiling Disk Master:
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 Proceed.
✍ Tips:
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 Qiling Disk Master 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 Qiling Disk Master 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!