If you encounter problems with your Windows 10/11 and you’re unable to solve them, or your computer won’t boot into Windows, don’t worry. Here’s a guide on how to repair your Windows 10/11 by using Command Prompt from Safe mode or via Windows Recovery.
Starting up Windows 10/11 in Safe Mode with Command Prompt
If you can only boot into safe mode with command prompt, or into the Windows Recovery Environment, there is still a chance to repair Windows 10/11 by using the command prompt tool before you reset or reinstall Windows.
To start, we will show you how to enter safe mode with command prompt on Windows 11/10, or access the command prompt from the Windows Recovery Environment. If you already know how to open the command prompt without booting into Windows, you may skip this step.
Entering Safe Mode with Command Prompt
If you still have access to your Windows 10/11, enter safe mode by Shift-clicking the Restart button from the Start menu. Next, select (6) from the Startup Settings to boot into safe mode with command prompt on the next restart.
If you have no access to your Windows 10/11, perform the following steps:
- Hold and press the power switch on your computer casing for about 5 seconds until your computer completely shuts down.
- Power on your computer and wait for it to start loading the Windows 10 or Windows 11 logo.
- Hold and press the power switch again to force another shutdown.
- Repeat steps 2-3 for 3-4 times.
- When Windows detects too many failed startups, it will automatically boot into Windows Recovery.
When you are in Windows Recovery, select Troubleshoot > Advanced Options > Startup Settings. Press the 6 key to boot into Windows safe mode with command prompt on the next restart.
Opening Command Prompt from Windows Recovery
If you’re still able to access Windows 10/11, enter Windows Recovery by going to Start menu > Settings > Update & Security > Recovery > Advanced startup. Click on Restart now to boot into Windows Recovery.
If you can’t access Windows, repeat the force shutdown steps mentioned above to force boot your PC into Windows Recovery Environment.
Once you’re in Windows Recovery, select Troubleshoot > Advanced Options > Command Prompt. You will then be able to execute commands directly from the Windows Recovery CMD.
If you have a recovery drive created prior to the problem, you can set your BIOS to boot the recovery drive to enter Windows Recovery Environment.
Repairing Windows 11/10 Using SFC scannow in CMD
The first repair command we’ll execute is the system file check (SFC). SFC is able to automatically scan for corrupted and missing system files, and repair or replace them in Windows 11/10. In the command prompt, enter the following command.
The process may take 30 minutes or up to several hours depending on the size of the Windows system files and your HDD performance. When the scan is completed, you can choose to restart your PC now to verify if the problem still persists or continue executing other commands below.
Running CHKDSK to Check for Hard Drive Errors
A hard drive error is one of the most common errors that causes Windows to crash or corrupt. Running check disk (chkdsk) will certainly help to check and repair unwanted disk errors on your HDD, especially on your Windows partition.
In the command prompt, enter the following command to perform chkdsk.
chkdsk c: /f
Since you’re not currently using your disk, chkdsk should not ask you to restart your PC. If it tells you that the volume is in use and that it will schedule the chkdsk scan on your next restart, press the Y key to proceed.
Similar to the system file check, the scan may take some time. Try not to interrupt the scan. When the scan is completed, restart your PC and verify if your problem is solved. Continue to the next repair command if the problem still exists.
Running DISM to Repair Windows 10/11 Image
Deployment Imaging and Servicing Management (DISM) is a Windows built-in tool to automatically update files and correct service problems for your Windows 10/11 image. In the cmd, enter the following command.
Dism /Online /Cleanup-Image /RestoreHealth
Running Bootrec to Repair Windows 10/11 Boot Problem
Bootrec.exe is an incredibly useful tool to repair boot problems in Windows 10/11. When startup repair or any kind of troubleshoot can’t repair your Windows boot problem, you should try using bootrec repair tool.
In the command prompt, enter the following commands followed by an Enter key after each line of command.
bcdboot c:\windows /s c:
These commands are to execute bootrec.exe to fix the Master Boot Record (MBR) and other boot problems in Windows 11/10. Replace C: if your Windows is stored on another drive. Reboot your computer after executing all commands.
If none of the solutions above work to repair your Windows boot problem, you may then decide if you want to system restore Windows 11/10 to a previous date, roll back Windows 11/10 update to an earlier build, or reset Windows 11/10 to factory settings.