Compartilhar via


Using System File Checker (SFC) To Fix Issues

Both Windows Vista and Windows Server 2008 include the System File Checker (SFC) tool. Previous operating systems included this tool also. This discussion is specific to Windows Vista and Windows Server 2008. If you would like more information on previous operating systems see the following KB article: https://support.microsoft.com/kb/310747.

SFC scans and checks all Windows Resource Protected (WRP) resources. Windows Vista adds the following new functionality to the SFC tool:

  • Ability to scan a single file
  • Ability to scan a Windows installation offline

Common SFC Command Line Options

Here are some of the common commands you would use with SFC. Note you need to run SFC from a elevated command prompt

Scan entire system
SFC.EXE /scannow

Scan a specific file
SFC.EXE /scanfile=c:\windows\system32\kernel32.dll

Verify. This scans all protected files but does not repair them
SFC.EXE /verifyonly

Help for Sfc.exe
SFC.EXE /?

One of the new features of SFC in Windows Vista/2008 is the ability to run SFC against a offline windows directory. This is most useful when you are unable to start Windows and suspect file corruption. Generally you should always try safe mode first before doing this to see if Windows can start. To use SFC in offline mode you do the following

  1. Boot from your Windows Vista or Windows Server 2008 DVD
  2. On the first screen of Setup choose Next
  3. In the lower left of the screen choose "repair your computer"
  4. On the System Recovery Options screen choose your installation of Windows and then click next
  5. Click "Command prompt"
  6. Type in the following command: SFC.EXE /scannow /offbootdir=c:\ /offwindir=c:\windows
  7. When complete type in exit to see if Windows starts up now.

Advanced users may want to see what SFC is repairing on a system. When SFC runs it logs it's actions to C:\WINDOWS\LOGS\CBS\CBS.LOG. You can find SFC specific entries by searching on [SR]. See https://support.microsoft.com/default.aspx/kb/928228 for more information.

Example of How SFC Can Fix Issues

The following is a example of how the system file checker was able to resolve a issue on my own computer. The issue I encountered was that When I would go into disk management my disks would show up but none of the information such as the type of disk, size, active/boot/system, healthy, etc... would show up. I checked the system event log and found the following

Capture

FMIFS.DLL is obviously a file used by disk management to display this information. If I look up the error code C1 it resolves to ERROR_BAD_EXE_FORMAT. So at this point I suspect that this file is corrupt. From within Windows I run the following command:

SFC.EXE /scannow

It runs and says that it has repaired files. To verify I look in the C:\WINDOWS\LOGS\CBS\CBS.LOG and see the following entries

Capture2

From this you can tell that SFC compared the hash for fmifs.dll and found it wasn't correct. It restored the backup from c:\windows\WinSxS\x86_microsoft-

windows-fmifs_31bf3856ad364e35_6.0.6000.16386_none_54d7af8934ac24f1. After running SFC I was now able to open disk management and see my disk information.

Hopefully this helps explain how SFC can help you resolve problems on your computer and shows how Microsoft is committed to making Windows easier to fix when issues do occur.

Author:
Scott McArthur
Support Escalation Engineer
Enterprise Platforms Support

Comments

  • Anonymous
    December 18, 2007
    PingBack from http://www.ditii.com/2007/12/18/fixing-issues-with-system-file-checker/

  • Anonymous
    December 19, 2007
    What I'm most interested in is how SFC in Windows Vista handles files which have been updated by hotfixes/service packs, ESPECIALLY, when checking an offline Windows installation. Do the original unpatched files from the Windows DVD get restored or the updated ones from some backup? Where is the backup made?

  • Anonymous
    April 22, 2008
    The comment has been removed

  • Anonymous
    May 24, 2009
    The comment has been removed

  • Anonymous
    February 01, 2010
    The comment has been removed

  • Anonymous
    February 09, 2011
    The comment has been removed

  • Anonymous
    July 24, 2013
    Will it work on sbs2011 for netlogon fails to start. 0xc0000064

  • Anonymous
    October 20, 2014
    verify only seems to be on by default... how do i turn it off?

  • Anonymous
    April 14, 2015
    The comment has been removed

  • Anonymous
    April 16, 2015
    For Shadow: boot from the installation CD/DVD then choose the repair option, then go to the command prompt.

  • Anonymous
    June 27, 2015
    Hi Scott
    OS : Windows Server 2012
    I am facing an issue that none of the https websites are opening in the IE. It gives an error of This page cannot be displayed.
    Also after i started getting this error, I wanted to install Teamviewer , but Durin Installation and even uninstalling i keep getting error which says " Verification of your Teamviewer version failed. Team viewer will quit for secirity reasons. Please re-install teamviewer"
    I had been looking on the Internet to resolve the https sites issue, but cannot get any resolution.
    1. On one of the websites http://www.techsupportall.com/solved-cannot-access-secure-sites-https-websites-not-opening-view/
    gives a resolution to Register the DLLs listed on the above webpage. When i tried that half of them failed.
    2. When i click on the fix connection problems on the IE it gives a following error : 0x80004001
    3. Googling on the above error led me to this page.
    4. I ran the following command SFC.exe /scannow but after the scan is complete it says windows did not find any integrity violations.

    Would appreciate a lot if you could help out on this.

    • Anonymous
      March 30, 2016
      Check system time, system time being way off breaks SSL.
  • Anonymous
    August 10, 2015
    I have to apply the sfc/scannow in more than 300 systems. We are using the system center 2012 configuration manager. Please help how to apply the same with this with administrative rights.

  • Anonymous
    September 07, 2016
    In the windows repair environment from ro media the original post says:o Click "Command prompt"o Type in the following command: SFC.EXE /scannow /offbootdir=c:\ /offwindir=c:\windowsThen the post says:o When SFC runs it logs it’s actions to C:\WINDOWS\LOGS\CBS\CBS.LOGThis isn't true in Windows 10, indeed, it doesn't seem to have been true since Vista. In fact sfc logs to %WINDOWS_TRACING_LOGFILE% (undocumented, but found by a number of people) and, if this file does not exist or if, indeed, the environment variable isn't set, it doesn't log. WinRE command prompt does not have the variable set, at least not when its sitting in RAM (i.e. from a boot of an ISO image, as recommended above.)Setting the variable allows sfc to log and, indeed, is convenient because it can be set to a sequence of files in x:\logs as we try to fix the problems that sfc cannot fix.

  • Anonymous
    December 28, 2017
    Found a great Microsoft page that uses Deployment Image Servicing and Management (DISM) before running SFC. DISM is ran online and uses Windows Update to repair the files. https://support.microsoft.com/en-us/help/929833/use-the-system-file-checker-tool-to-repair-missing-or-corrupted-system. Justin