How to Run SFC Offline System File Checker
In this article
Running the System File Checker (SFC) offline is a way to repair corrupted or missing Windows system files when the normal online scan fails or when Windows won't start properly. This guide shows you how to launch SFC from the Windows Recovery Environment (WinRE) or from a bootable installation drive, so you can fix your system even if you can't log in. You'll need a Windows installation USB or DVD, or access to the recovery menu on your PC.
What You'll Need
- A Windows installation USB drive or DVD (matching your Windows version, e.g., Windows 10 or 11).
- Alternatively, access to the Windows Recovery Environment (WinRE) if your PC can boot to it.
- A basic understanding of command prompt commands.
- Your Windows product key is not required for this process.
Step-by-Step
- Boot from your installation media or enter recovery.
- Insert your USB/DVD and restart your PC. Press the boot menu key (often F12, F2, Esc, or Del) during startup to select the drive.
- If you can't boot from media, try to access WinRE by holding Shift while clicking Restart from the login screen, or by interrupting startup three times (power off during boot) to trigger automatic repair.
- Open Command Prompt from the recovery environment.
- If booting from installation media: choose your language, then click “Repair your computer” (bottom-left) instead of “Install now”.
- In WinRE, go to Troubleshoot → Advanced options → Command Prompt.
- Identify your Windows drive letter.
- In the Command Prompt, type
diskpartand press Enter. - Type
list volumeand press Enter. Note the drive letter assigned to your Windows installation (usually C:, but in recovery it might be D: or E:). Look for the volume with the “Windows” label or the largest size. - Type
exitto leave diskpart.
- In the Command Prompt, type
- Run SFC with the correct drive letter.
- Type the following command, replacing
D:with your actual Windows drive letter: sfc /scannow /offbootdir=D:\ /offwindir=D:\Windows- Press Enter. The scan will begin and may take 15-30 minutes or longer.
- Type the following command, replacing
- Wait for the scan to complete.
- Do not close the Command Prompt or restart your PC during the scan. You'll see a progress percentage and a final summary message.
- Review the results.
- If SFC finds and fixes issues, you'll see “Windows Resource Protection found corrupt files and successfully repaired them.”
- If it can't fix everything, you'll see a message directing you to check the CBS.log file.
- Exit and restart.
- Type
exitto close Command Prompt, then choose “Continue” or restart your PC normally.
- Type
Common Mistakes
- Using the wrong drive letter: In the recovery environment, the Windows drive is often not C:. Using C: will cause SFC to scan the recovery drive instead, and it will report errors or do nothing useful.
- Forgetting the /offbootdir and /offwindir switches: Running plain
sfc /scannowin recovery won't work; it will say it can't run or will scan the wrong location. - Interrupting the scan: Closing the window or restarting mid-scan can leave the system in an inconsistent state.
- Booting from the wrong media: If your installation USB is for a different Windows version (e.g., 32-bit vs 64-bit), SFC may fail or behave unexpectedly.
Tips
- Always note the drive letter from
list volume– it's the most reliable way to avoid mistakes. - If SFC finds issues it can't fix, run DISM (Deployment Imaging Service and Management Tool) offline before re-running SFC. In the same Command Prompt, type:
dism /image:D:\ /cleanup-image /restorehealth(replace D: with your drive). This repairs the component store that SFC relies on. - Make sure your PC is plugged into a power source during the scan to avoid shutdowns.
- If you have a system restore point, consider using it as an alternative before running SFC offline.
- Run SFC from normal Windows (Start → type “cmd” → right-click → Run as administrator →
sfc /scannow) if you can still log in – it's simpler and often sufficient.
Troubleshooting
- SFC says “Windows Resource Protection could not perform the requested operation.”
- This usually means the drive letter is wrong or the Windows folder path is incorrect. Re-run diskpart and double-check the volume letter.
- Ensure you're using the exact syntax with double backslashes:
/offbootdir=D:\and/offwindir=D:\Windows.
- SFC completes but says it found corrupt files it couldn't fix.
- Run DISM offline as described in Tips, then re-run SFC. If it still fails, you may need to perform a repair install (in-place upgrade) using your installation media.
- Command Prompt doesn't open in recovery.
- If you're booting from a USB, make sure the media is created correctly (use Microsoft's Media Creation Tool). If you're using WinRE, try the “Startup Repair” option first – it may fix boot issues that prevent Command Prompt from loading.
- SFC is stuck at a certain percentage.
- Wait at least 30 minutes before assuming it's stuck. If it truly freezes, restart and try again, but first run
chkdsk D: /f(replace D:) to check for disk errors.
- Wait at least 30 minutes before assuming it's stuck. If it truly freezes, restart and try again, but first run
- You don't have installation media.
- You can create one on another PC using Microsoft's free Media Creation Tool. Alternatively, try to boot into WinRE by holding Shift+Restart from the login screen.
Frequently Asked Questions
Can I run SFC offline without installation media?
Yes, if you can access the Windows Recovery Environment (WinRE) by holding Shift while clicking Restart from the login screen, or by interrupting startup three times. WinRE includes Command Prompt.
What does /offbootdir and /offwindir do?
These switches tell SFC where the boot files and Windows folder are located, because in the recovery environment drive letters differ from normal Windows. Without them, SFC can't find your system files.
How long does an offline SFC scan take?
Typically 15-30 minutes, but it can take longer on older hard drives or if there are many corrupt files. Let it run uninterrupted.
Will SFC offline delete my personal files?
No. SFC only repairs system files. Your documents, photos, and other personal data are untouched.
What if SFC finds errors but can't fix them?
Run DISM offline (as shown in Tips) to repair the component store, then re-run SFC. If that fails, consider a repair install using your installation media, which keeps your files and apps.
Is there a difference between online and offline SFC?
Online SFC runs while Windows is active and uses the current system in real-time. Offline SFC runs from recovery and is necessary when Windows won't boot or when online SFC fails due to files being in use.