This guide shows you how to use the sfc utility for the following Windows versions: Windows XP, Vista, 7, 8, 8.1 and 10.

About sfc

Sfc or sfc.exe stands for System File Checker. It’s a utility in Microsoft Windows operating systems, starting from Windows 98, that allows you to scan and restore corruptions in system files.

The sfc utility is available for Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10.

To run this utility you need to be logged in as an Administrator.

Parameters

The most command parameter for this utility is:

sfc /scannow

The /scannow command will scan for issues and, if it finds one, it will attempt to replace the files that have issues from the DLL Cache.

In Windows Vista or later (7, 8, 8.1), the sfc utility can be used to scan individual files.

Other parameters for the sfc utility are:

sfc /scanonce will scan the system files only once.

sfc /scanboot will scan the system files at every boot of your computer

sfc /revert will return the scan to its default operating

sfc /purgecache will remove the Windows File Protection cache and begin a scan over the system files

sfc /cachesize=x, where x is the size in MB, will set the cache size of the Windows File Protection

sfc /? will display the help list

Run sfc in Easy Recovery Essentials

You can download and burn Easy Recovery Essentials on any CD, DVD or USBs and run the sfc.exe commands you need.

To do so, follow these steps:

  1. Download Easy Recovery Essentials
  2. Burn the ISO image. Follow our instructions on how to burn a bootable ISO image to a CD or DVD. If you’d like to have a recovery USB instead, follow these instructions.
  3. Boot into Easy Recovery Essentials
  4. Select Launch Command Line

Run sfc in Windows XP

To run the sfc utility in Windows XP, follow these steps.

If you run the utility while you’re logged into Windows XP:

  1. Open Command Prompt. To do so, go to Start > Run and type cmd and click OK.
  2. Type the /scannow command and press Enter:
    sfc /scannow

If you run sfc outside Windows XP, e.g. when you’re at Recovery Console or via Easy Recovery Essentials if you can’t boot into Windows XP, you need to set the path where your Windows XP is installed:

  1. Open Command Prompt
  2. Type this command, but replace c:\ with the letter of the drive where your Windows XP is installed:
    sfc /scannow /offbootdir=c:\ /offwindir=c:\windows
  3. Press Enter

If System File Checker founds any errors and repairs the issues found, restart your computer before you boot into Windows XP.

To run the commands using your Windows XP installation disc, follow these steps:

  1. Insert the installation CD in the disc tray
  2. Restart the computer
  3. At the Press any key message, press any key on your keyboard to boot from the CD
  4. At the Welcome to Setup screen, press R to open Recovery Console
  5. Enter the Administrator password
  6. When Command Prompt appears, type the sfc command and press Enter:
    sfc /scannow /offbootdir=c:\ /offwindir=c:\windows

    Replace c:\ with the letter of the drive where your Windows XP is installed.

Run sfc in Windows Vista

To run the sfc in Windows Vista, follow these steps:

  1. Click Start
  2. Click All Programs
  3. Click Accessories
  4. Right-click on Command Prompt
  5. Click Run as Administrator
  6. If UAC (User Account Control) appears, click Yes or Continue to continue to open Command Prompt as Administrator
  7. When the Command Prompt appears, type: sfc /scannow
  8. Press Enter

If you can’t boot into Windows Vista, use your original installation disc. To do so, follow these steps below.

If you don’t have the installation disc, go to Run sfc in Easy Recovery Essentials. You can burn EasyRE on any CD, DVD or USBs.

  1. Insert the original Windows Vista DVD in the disc tray
  2. Boot from the DVD
  3. Choose a language and keyboard layout
  4. At the Welcome screen, click on Repair your computer
  5. Choose your operating system from the list
  6. Click Next
  7. At the System Recovery Options window, click Command Prompt
  8. Type the command and press Enter:
    sfc /scannow /offbootdir=c:\ /offwindir=c:\windows

    Replace c: with the letter of the drive where Windows Vista is installed.

Run sfc in Windows 7

To run the sfc in Windows Vista, follow these steps:

If you can’t boot into Windows 7, go to Run sfc in Easy Recovery Essentials.

  1. Click Start
  2. Type command prompt in search box
  3. Right-click on the first item in search results list: Command Prompt
  4. Click Run as administrator
  5. Click Continue or Yes on the UAC warning window to allow this action
  6. When Command Prompt appears, type the command:
    sfc /scannow
  7. Press EnterThe scannow sfc command

You can also run the sfc command via the installation disc or the System Recovery Options panel installed on your computer.

Method #1

  1. Insert the original Windows 7 installation DVD in the disc tray and reboot your computer
  2. Press any key when it says “Press any key to boot from CD or DVD..”
  3. Select a language and keyboard option
  4. Click Repair your computer
  5. Select your operating system
  6. Choose Command Prompt
  7. Type the command and press Enter:
    sfc /scannow /offbootdir=c:\ /offwindir=c:\windows

    Replace c: with the letter of the drive where Windows 7 is installed.

Method #2

  1. Restart your computer
  2. Press the F8 key several times during booting before the Windows 7 logo appears
  3. At the Advanced Options screen, select Repair your computer

    If Repair your computer option isn’t available, follow Method #1 above.

  4. Select a keyboard and language
  5. Select Command Prompt
  6. Type the command and press Enter:
    sfc /scannow /offbootdir=c:\ /offwindir=c:\windows

    Replace c: with the letter of the drive where Windows 7 is installed.

Run sfc in Windows 8 or 8.1

To run the sfc in Windows 8 or Windows 8.1, follow these steps:

  1. Boot into your system
  2. Press the Windows and C key to open the Charm Bar
  3. Type command prompt or cmd in the search field
  4. From the search results list, right-click on Command Prompt
  5. Select Run as Administrator
  6. Enter the password
  7. When Command Prompt loads, type the sfc command and press Enter:
    sfc /scannow

You can also run the utility from the Windows installation disc. To do so, follow these steps below.

If you don’t have the installation disc, go to Run sfc in Easy Recovery Essentials. You can burn EasyRE on any CD, DVD or USBs.

  1. Insert the disc and restart the computer
  2. Press any key to boot from the DVD
  3. Choose your keyboard layout, time and language
  4. Click Next
  5. Click Repair your computer
  6. Click Troubleshoot
  7. Click Advanced options
  8. Click Command Prompt
  9. Type the command and press Enter:
    sfc /scannow /offbootdir=c:\ /offwindir=c:\windows

Run sfc in Windows 10

To run the sfc in Windows 10, follow these steps:

  1. Boot into your system
  2. Press the Windows key to open the Start Menu
  3. Type command prompt or cmd in the search field
  4. From the search results list, right-click on Command Promptcmd
  5. Select Run as Administrator
  6. Enter the password
  7. When Command Prompt loads, type the sfc command and press Enter:
    sfc /scannow

You can also run the utility from the Windows installation disc. To do so, follow these steps below.

If you don’t have the installation disc, go to Run sfc in Easy Recovery Essentials. You can burn EasyRE on any CD, DVD or USBs.

  1. Insert the disc and restart the computer
  2. Press any key to boot from the DVD
  3. Choose your keyboard layout, time and language
  4. Click Next
  5. Click Repair your computerWindows 10 Setup screen
  6. Click Troubleshoot
  7. Click Advanced options
  8. Click Command Prompt
  9. Type the command and press Enter:
    sfc /scannow /offbootdir=c:\ /offwindir=c:\windows

Troubleshooting

sfc isn’t recognized

If the sfc commands you’re typing in Command Prompt aren’t being recognized, make sure that:

  • You’re logged in as an Administrator
  • Or you’re logged in as a user of an Administrator group

Windows Resource Protection could not perform

You may receive this error while trying to perform a /sfc scannow:

Windows Resource Protection could not perform the requested operation

This error usually appears if the hard disk has corruptions or bad sectors. To fix this error, you can try any of the following tips:

Tip #1: Boot into Safe Mode

Try to run the sfc /scannow command while in Safe Mode. To boot into Safe Mode, follow these steps:

  1. Boot your computer
  2. Press the F8 key before the Windows logo appears
  3. At the Windows Options screen, use the arrows keys and select Safe Mode
  4. Press Enter

To get the full instructions on how to boot into Safe Mode, read our guide on Safe Mode with instructions for each Windows version:

Tip #2: Run chkdsk

If Tip #1 doesn’t work, also try to run chkdsk commands to check if your hard disk has bad sector or corruption issues.

To run chkdsk (related guide: chkdsk), follow these steps:

    1. Insert the original Windows installation CD or DVD
    2. Go to Command Prompt. Depending on your Windows version, Command Prompt is:
      • Windows XP: Go to Recovery Console
      • Windows Vista or 7: Go to System Recovery Options
      • Windows 8 or 8.1: Go to Troubleshoot > Advanced Options
    3. When Command Prompt appears, type this command:
      chkdsk c: /r

      Where c: is where your Windows is installed.

Press Enter

Windows Resource Protection could not start the repair service

The sfc utility may return the following error when you try to run it:

Windows Resource Protection could not start the repair service

If it returns this error, run the following commands:

  1. ren c:\windows\winsxs\pending.xml pending.old

    Replace C with the drive’s letter where Windows is installed on.

  2. sfc /scannow /offbootdir=[c]:\ /offwindir=[c]:\windows

    Replace C with the drive’s letter where Windows is installed on.

More Information

Support Links

Applicable Systems

This Windows-related knowledgebase article applies to the following operating systems:

  • Windows XP (all editions)
  • Windows Vista (all editions)
  • Windows 7 (all editions)
  • Windows 8 (all editions)
  • Windows 8.1 (all editions)
  • Windows 10 (all editions)

Propose an edit

Tagged: