To fix Windows 10 with command prompt (4 methods)

command prompt windows 10
command prompt windows 10

Dernière mise à jour: 24 mai 2024

Although Windows 10 is one of Microsoft's most reliable operating systems, over time it could malfunction, become infected with malware or show a blue screen. Therefore, you may need to repair Windows 10 to resolve these problems. Fortunately, there are different ways to repair Windows 10.

In this article, I explain how to fix Windows 10 using command prompt, as it is a proven troubleshooting technique.

How to fix Windows 10 using SFC?

SFC (System File Checker) is a command line utility that scans all protected system files and replace damaged files with a full copy.

When you notice problems with Windows 10, you can use SFC to diagnose problems and repair them. Here is the procedure to follow:

  • Open Start , look for thecommand prompt, select it and run as administrator. To do this, in the search bar of Windows, enter “commands”, right-click on it and click on Execute as administrator.

  • Then type the following command and press Starter.
    sfc /scannow

  • The verification will start, wait a bit. Finally, any errors will be corrected automatically in the event of a problem.

Be aware that the SFC tool is limited since it only controls system files, particularly DLLs. If your problem is caused by a driver or an error in the registry, unfortunately it will do nothing for you.

In this case, you can use DISM to repair the image Windows 10.

How to fix Windows 10 using DISM?

DISM verifies the integrity of Windows in order to fix corrupted images. The utility can be used to repair and prepare images Windows, including recovery environment Windows and the installation of Windows. Likewise, DISM can be used to repair the recovery image in an operating system installation and even to repair a virtual hard disk.

Here is the procedure to follow to repair Windows 10 using DISM commands:

  1. Corruption check: Run the command line as administrator, then type the following command and press "Enter":
    DISM /Online /Cleanup-Image /CheckHealth
  2. Image analysis Windows : To analyze the image Windows looking for corruption, type the command below and press “Enter”:
    DISM /Online /Cleanup-Image /ScanHealth
  3. Image correction Windows : To correct the image Windows, type the following command and press “Enter”:
    DISM /Online /Cleanup-Image /RestoreHealth /Source:repairSource\install.wim

 reset Windows 10 with the command line

The Reset This PC feature can reset Windows to its factory default state.

To reset Windows 10, follow the instructions below:

Type this command in a command prompt and press Enter:

systemreset -cleanpc

(If your computer cannot boot, you can boot into recovery mode and select Troubleshoot, then choose Reset this PC.)

Two options are provided, Keep my files et Delete all. You can then select the option you need to reset your PC.

Launch System Restore with Command Prompt

If the problem is too serious, you can try to restore your Windows 10 to the previous state as long as you have System Restore enabled.

System Restore fromcommand prompt Windows 10 is a very useful way when your system crashes or cannot boot.

System Restore allows you to restore Windows at an earlier date where everything was working fine, to make your computer normal. It does not affect personal data or files, such as emails, documents or photos.

To run System Restore under Windows 10, follow the steps below:

  • Open Command Prompt. To do this, type cmd in the search box and launch Command Prompt as administrator.
  • Once the command prompt appears, first enter rstrui.exe  and press Starter. This command will take you to the System Restore interface.
  • Choose a restore point. Select a date on which, or before which, you know your computer was functioning properly, and click Next.
  • You will have a confirmation window. Click Finish to start the restoration process. The computer restarts automatically.