When you buy through our links, we may earn a commission. Learn more ›

How to Use SFC and DISM to Repair Your Laptop

Short answer: Run DISM first, then SFC, from an elevated Command Prompt. DISM repairs the Windows component store, and SFC checks protected system files against known good copies. If an update, startup, or core Windows component is causing problems, this two-step repair routine is the safest first move before resetting or reinstalling Windows.

When a Windows coding laptop needs repair

Corrupted system files can show up as a Windows install that fails to update, a settings page that will not open, a startup loop, or an error from a core component such as Windows Security. These failures are different from a syntax error in your project or a broken package install: your code still looks fine, but the operating system itself is not behaving.

Before you reset Windows or reinstall it, run the two built-in repair tools: DISM first, then SFC. They are worth knowing because they are the least destructive repair path for a Windows machine, and they are already on the system.

What SFC and DISM actually do

SFC, or System File Checker, scans protected system files and replaces corrupted versions when it can. DISM, or Deployment Imaging Servicing and Management, repairs the Windows image and the component store that Windows Update and SFC depend on.

If the component store is damaged, SFC may not be able to find a healthy copy of a file. Run DISM first to repair the image, then run SFC to check the protected files against the repaired component store.

  • DISM first: `DISM /Online /Cleanup-Image /RestoreHealth`
  • SFC second: `sfc /scannow`

Step 1: Open an elevated Command Prompt

SFC and DISM require administrator rights. Press Start, type `cmd`, right-click Command Prompt, and choose Run as administrator. If you use Windows Terminal, open it as administrator, then switch to a Command Prompt tab or run the commands from the Command Prompt profile.

An elevated terminal has a title bar that usually says Administrator. If the window is not elevated, SFC reports that it must be run from an elevated command prompt.

Step 2: Run DISM first

Run this command in the elevated Command Prompt:

DISM will check the Windows image and repair the component store from Windows Update when it can. The command may appear to pause at a certain percentage; let it finish and do not close the terminal.

If DISM cannot repair the image by itself, a more advanced pass can point to a valid Windows image source in some setups, but the exact command depends on your installation media. For most people, the normal `RestoreHealth` pass is the first step.

  • `DISM /Online /Cleanup-Image /RestoreHealth`

Step 3: Run SFC after DISM

Run this command in the same elevated Command Prompt:

SFC will scan protected system files and replace any corrupted ones it can repair. After DISM, SFC has a healthier component store to draw from.

If SFC reports that it found corrupted files but could not fix some of them, run DISM again, then run SFC again. The two tools work together; one pass is often not enough when the image was badly damaged.

  • `sfc /scannow`

When Windows will not start normally

If the laptop will not boot into Windows, open the Windows Recovery Environment instead. From there, you can choose Troubleshoot, then Advanced options, then Command Prompt. In that prompt you can run the same DISM and SFC commands. See how to boot into the Windows Recovery Environment for the full path.

A recovery drive is a useful companion because it gives you a way to reach the recovery tools even when the normal startup path is damaged. See how to create a Windows recovery drive.

What SFC and DISM do not fix

SFC and DISM are aimed at Windows system files. They do not reinstall applications, repair user profile damage, or update third-party drivers. If your editor is crashing, reinstalling the editor is usually a faster and more direct fix. Visual Studio Code, for example, is a small download with a disk footprint under 500 MB, so the repair path for that app is rarely a Windows image repair.

Docker Desktop has a Windows install path, but if you are seeing container-specific errors rather than operating-system errors, start with the Docker installation docs and the Docker Desktop setup flow. SFC and DISM are not a substitute for a correct container runtime.

For driver-level instability, use the laptop maker's support tooling where possible. See how to update laptop drivers and BIOS.

SFC and DISM are Windows-only tools

These repair commands do not apply to macOS. If you also develop for Apple platforms, the Xcode system requirements page lists the macOS versions Xcode supports, and Apple hardware such as the MacBook Air ships with macOS. On that side of your workflow, you would use macOS recovery instead of SFC and DISM.

If you work on both Windows and Apple platforms, keep the two repair paths separate. For the Mac side of that work, see the best laptops for iOS and macOS development.

Repair tools are not a hardware upgrade

Running SFC and DISM can restore a damaged Windows install, but it cannot give a laptop more RAM or faster storage. If a laptop needs frequent system repairs, or if the workload has outgrown the hardware, the better fix is to choose a machine that matches the work.

If you spend most of the day in a browser, an editor, and a local server, start with the best laptops for programming. If you run Docker Desktop and virtual machines, check the best laptops for Docker and virtual machines and make sure virtualization is enabled with how to enable virtualization for Docker and VMs.

What to pick for your work

If youPickBuying guide
Windows Update, startup, or a core Windows component is failing on your current laptopRun DISM, then SFC, then rerun both before you reset or reinstall WindowsBest Laptop for Programming in 2026: 14 Picks by Specs
You are a web developer and only your editor, browser, or local server misbehavesReinstall the application first; SFC and DISM are not the first repair tool for app-level problemsBest Laptops for Web Development in 2026: 14 Picks by Specs
You run Docker Desktop or virtual machines and Windows itself is also failingRun the repair sequence, then verify the virtualization and system configuration for containersBest Laptops for Docker and Virtual Machines in 2026: 14 Picks
Your current Windows laptop still needs repairs after SFC and DISM completeLook at whether the hardware and memory configuration fit your workload before choosing a next laptopBest Laptop for Programming in 2026: 14 Picks by Specs
You also build for iOS or macOSUse SFC and DISM only on Windows; choose Apple hardware for Xcode-based developmentBest Laptops for iOS and macOS Development in 2026: 12 Apple Picks

Questions

Should I run SFC or DISM first?

Run DISM first, then SFC. DISM repairs the component store that SFC depends on. If SFC runs first and the component store is damaged, it may not be able to restore a file correctly.

Do I need administrator rights to run SFC and DISM?

Yes. Open Command Prompt as administrator, or open Windows Terminal as administrator. The tools will not run from a normal user prompt.

Can SFC and DISM fix a laptop that does not power on?

No. If the hardware does not turn on, the repair tools are not the right step. They are for repairing Windows when it is running or when you can reach the Windows Recovery Environment.

Will SFC and DISM delete my projects or personal files?

They target Windows system files, not development projects. Back up important work before running system repairs, and keep your work in version control.

What should I do if SFC says it cannot repair some files?

Run DISM again, then run SFC again. If the problem remains after multiple passes, the next step is usually a Windows reset or clean installation rather than a repeated repair attempt.

How long do SFC and DISM take?

It depends on the system and the amount of damage. Let both commands finish without closing the terminal, even if they appear to pause.

Recent updates

  • : First published.

Sources

Related buying guides