• 1000001: Using the System File Checker

    Home » Forums » Knowledge Base » 1000001: Using the System File Checker

    Author
    Topic
    #83021

    AKB1000001: Using the System File Checker 

    By @NoelCarboni

    Published 2 Feb 2017 rev 1.0

    Microsoft provides a self healing feature for Windows called Windows File Protection. It’s been around for a while, actually. Windows File Protection helps keep Windows sane by watching for un-sanctioned changes to system files. A particular program called the System File Checker (SFC) is provided as part of Windows File Protection:

    https://blogs.technet.microsoft.com/askcore/2007/12/18/using-system-file-checker-sfc-to-fix-issues/

    The short story is that you want to get a little geeky you can use SFC to see if your Windows installation is healthy. It’s quite easy – just start an elevated CMD window and run this command:

    SFC /VERIFYONLY

    Go ahead and try it. It’ll run for a few minutes – or maybe even a few tens of minutes – and it will thoroughly check all your Windows system files.

    Note that just checking your system’s health shouldn’t harm anything. It’s only checking, not changing things. You might even get a warm and fuzzy feeling when SFC says all’s well!

    But the all important question is: What do you do if SFC reports an error?

    SFC can be asked to try to repair basic problems it finds with the Windows system files using your local servicing database (hey, some of the data in all those gigabytes of Windows installation can actually be useful). Specifically If the above SFC /VERIFY command says there are errors, you can try a next step: Run SFC again but this time with a different switch, where you ask it to actually fix any errors it finds.

    Note that if you have been hacking Windows system files yourself, you might have caused the errors yourself and an SFC repair will likely undo those hacks. I personally recommend never doing hacks that change system files and break Windows File Protection. It’s quite possible to run a customized and tuned up Windows 8 system that still passes SFC checks – I do!

    This command asks SFC to repair any problems it finds:

    SFC /SCANNOW

    It might tell you that it found and repaired the errors. If so, that’s great and here comes that warm and fuzzy feeling. You’re all done!

    But – unfortunately – there are some errors this command can’t fix. Like any files, the servicing database itself in Windows can become corrupted, making an SFC repair impossible. It can and does happen.

    If SFC /SCANNOW informs you that it could not repair errors, you can dig through the file C:\Windows\Logs\CBS\CBS.log to find out why. It’s cryptic and voluminous, but a search for the string “cannot repair” often turns up the key clues. Pay attention to the dates and times as data from multiple runs accumulates in that log file, but persistence pays.

    Last month I observed that an uncorrectable error was introduced on my Windows 8.1 system after I installed the December set of “Group A” (everything cumulative) updates:

    Specifically, SFC reported (via CBS.log) that the file Sound Recorder.lnk was corrupted and that the corruption couldn’t be repaired because the “source file in the store was also corrupted”.

    Fortunately, with Windows 8 and newer there’s a way to escalate the automatic repair process to yet another level – and it really works – using a DISM command. DISM is the Deployment Imaging and Servicing Management tool provided with Windows. Yep, now we’re gettin’ seriously geeky. Just like a crack IT professional.

    Specifically, if you find yourself with errors that SFC just can’t repair, clear your schedule for 10 minutes or so and try this command:

    DISM /Online /Cleanup-Image /RestoreHealth

    It actually goes online to the Windows Update site and does what it can to repair the local servicing database on your running system! After running it, SFC /SCANNOW might actually be able to repair those errors it couldn’t repair before!

    You can find more information on Microsoft’s site about DISM:

    https://technet.microsoft.com/en-us/library/hh824869.aspx

    Once the DISM command is done – which may take quite a while so be patient – go back and try the SFC /SCANNOW command again. There’s a good chance it will now succeed and you might actually get back to that warm feeling that Windows is healthy.

    It worked for me.

    SFCSuccess

    10 users thanked author for this post.
    Viewing 14 reply threads
    Author
    Replies
    • #83189

      Quoted from
      http://www.howtogeek.com/222532/how-to-repair-corrupted-windows-system-files-with-the-sfc-and-dism-commands/

      “On Windows 7 and earlier, the DISM command isn’t available. Instead, you can download and run the System Update Readiness Tool from Microsoft and use it to scan your system for problems and attempt to fix them.”

      1 user thanked author for this post.
      • #89418

        Yes BUT,

        When I was on W 7, the “System Readiness Tool” did not repair anything. That is one of the main reasons I went to W 8(it sure wasn’t the GUI).

        Also SFC is much more comprehensive on W 8 and higher and is still being enhanced on W 8.1 and especially W 10.

        Best Regards,

        Crysta

        --------------------------------------

        1. Tower Totals: 2xSSD ~512GB, 2xHHD 20 TB, Memory 32GB

        SSDs: 6xOS Partitions, 2xW8.1 Main & Test, 2x10.0 Test, Pro, x64

        CPU i7 2600 K, SandyBridge/CougarPoint, 4 cores, 8 Threads, 3.4 GHz
        Graphics Radeon RX 580, RX 580 ONLY Over Clocked
        More perishable

        2xMonitors Asus DVI, Sony 55" UHD TV HDMI

        1. NUC 5i7 2cores, 4 Thread, Memory 8GB, 3.1 GHz, M2SSD 140GB
        1xOS W8.1 Pro, NAS Dependent, Same Sony above.

        -----------------

    • #83358

      The MS Technet article on DISM is not long being maintained. See top yellow highlighted bar on article. It may not be the best source of information on DISM in the future.

      • #83869

        Well, I originally wrote this against Windows 8 and posted it in the Windows 8 section of the site. That version of the OS isn’t changing that much either at this point. 🙂

        -Noel

        1 user thanked author for this post.
    • #83477

      I do this regularly(albeit with Scannow which actually does some repair) before and after major updates. It has saved me allot of grief and is one of the major reasons I left W 7 SP 1. Here is my script I C&P into Powershell(or CMD):

      ReagentC /Info
      sfc /scannow
      DISM /Online /Cleanup-Image /RestoreHealth
      DISM /Online /Cleanup-Image /AnalyzeComponentStore
      DISM /Online /Cleanup-Image /StartComponentCleanup
      DISM /Online /Cleanup-Image /AnalyzeComponentStore

      Best Regards,

      Crysta

      --------------------------------------

      1. Tower Totals: 2xSSD ~512GB, 2xHHD 20 TB, Memory 32GB

      SSDs: 6xOS Partitions, 2xW8.1 Main & Test, 2x10.0 Test, Pro, x64

      CPU i7 2600 K, SandyBridge/CougarPoint, 4 cores, 8 Threads, 3.4 GHz
      Graphics Radeon RX 580, RX 580 ONLY Over Clocked
      More perishable

      2xMonitors Asus DVI, Sony 55" UHD TV HDMI

      1. NUC 5i7 2cores, 4 Thread, Memory 8GB, 3.1 GHz, M2SSD 140GB
      1xOS W8.1 Pro, NAS Dependent, Same Sony above.

      -----------------

      2 users thanked author for this post.
    • #83715

      The self-healing feature is not called System Protection, which is the Restore Points storage in all versions from WinME to Win10: https://en.wikipedia.org/w/index.php?title=System_Protection&redirect=no

      Since Windows 2000, SFC has been part of Windows File Protection which does replace system files:
      https://en.wikipedia.org/wiki/Windows_File_Protection

      Windows 11 Pro version 22H2 build 22621.2361 + Microsoft 365 + Edge

      1 user thanked author for this post.
    • #83881

      Please be aware that users of Windows 7 Group B style of updating (without all Recommended patches) are likely to run into an issue breaking the functionality of SFC.
      If you require (and everyone does) SFC functionality, think again about your preferred style of updating.

      • #89467

        All Updates do way more than One realizes or that MS will ever be prepared to Itemize.
        I would think that this will and does pertain especially to built in TOOLS.

        If a Patch/CU/Security/etc including a necessary Hotfix(not the special very specific ones) includes augmentation to A TOOL, without it the TOOL maybe broken…..

        Best Regards,

        Crysta

        --------------------------------------

        1. Tower Totals: 2xSSD ~512GB, 2xHHD 20 TB, Memory 32GB

        SSDs: 6xOS Partitions, 2xW8.1 Main & Test, 2x10.0 Test, Pro, x64

        CPU i7 2600 K, SandyBridge/CougarPoint, 4 cores, 8 Threads, 3.4 GHz
        Graphics Radeon RX 580, RX 580 ONLY Over Clocked
        More perishable

        2xMonitors Asus DVI, Sony 55" UHD TV HDMI

        1. NUC 5i7 2cores, 4 Thread, Memory 8GB, 3.1 GHz, M2SSD 140GB
        1xOS W8.1 Pro, NAS Dependent, Same Sony above.

        -----------------

    • #83908

      Thanks, Noel. I just ran sfc /verifyonly on my Win 7 Pro SP 1 that I’ve been running for years now. I have essentially been in Group B since the GWX debacle started in 2015. Results: 100% OK. Now I have some added “warm fuzzies”… 😉

      Win10 Pro x64 22H2, Win10 Home 22H2, Linux Mint + a cat with 'tortitude'.

      1 user thanked author for this post.
    • #84364

      I followed Noel’s instructions, doing VERIFYONLY 1st, then SCANNOW. SCANNOW indicated problems it couldn’t repair, so I ran DISM, then SCANNOW again. My PC was low on battery power & shut down on the last scan. I ran SCANNOW again & I have the warm fuzzies! This was the 1st time ever running SFC & DISM since I bought my Windows 8 (now 8.1) laptop 4 years ago.

      Bought a refurbished Windows 10 64-bit, currently updated to 22H2. Have broke the AC adapter cord going to the 8.1 machine, but before that, coaxed it into charging. Need to buy new adapter if wish to continue using it.
      Wild Bill Rides Again...

    • #84649

      You will be interested to know that I just linked this web page to an answer to a question on the Microsoft Answers forum.

      CT

      1 user thanked author for this post.
    • #89301

      Woody,

      When I try to run sfc (either verifyonly or scannow) all I get is aVERY brief flash of a DOS screen, then nothing else happens. Is there maybe something wrong going on here? Running Win 7 X64 SP1.

      I would attach a screen shot, but the flash of a DOS screen only lasts about 1/4 second.

      Thanks, in advance for any help or advice.

      Dave

      • #89306

        Have you opened the Command prompt window using Run as administrator?

        CT

      • #90638

        Try running Windows PowerShell (admin) if it’s available on Windows 7. That’s where I ran SFC instead of the Command Prompt.

        Bought a refurbished Windows 10 64-bit, currently updated to 22H2. Have broke the AC adapter cord going to the 8.1 machine, but before that, coaxed it into charging. Need to buy new adapter if wish to continue using it.
        Wild Bill Rides Again...

      • #94145

        This was lost in the crash 2/13/2017:

        Start\All Programs\Accessories\
        RIGHT click on Command Prompt
        Choose “Run as Administrator”
        At the prompt in the black box that pops up type
        SFC /scannow

        1 user thanked author for this post.
    • #89409

      Canadian Tech,

      Yes I have. The same thing happens there, too.

      Dave

    • #89506

      PKCano,

      Thanks for the tip. I’ll try installing it later this evening and let you know what happens.

      Dave

    • #90692

      Try running Windows PowerShell (admin) if it’s available on Windows 7. That’s where I ran SFC instead of the Command Prompt.

      Begging your Pardon Sir,

      But one needs AT LEAST CMD(Command Prompt) as Admin(elevation) to run SFC. I do usually use Powershell and it CAN be Installed on W 7. See the Following:

      Install and configure WMF 5.1 https://msdn.microsoft.com/en-us/powershell/wmf/5.1/install-configure

      Windows Management Framework (WMF) 5.1 Released | Windows PowerShell Blog https://blogs.msdn.microsoft.com/powershell/2017/01/19/windows-management-framework-wmf-5-1-released/

      WMF 5.1 Release Notes https://msdn.microsoft.com/en-us/powershell/wmf/5.1/release-notes

      PowerShell Magazine » Comparing commands between PowerShell versions http://www.powershellmagazine.com/2016/04/29/comparing-commands-between-powershell-versions/

      PowerShell Gallery | Home https://www.powershellgallery.com/

      Get Started with the PowerShell Gallery | MSDN https://msdn.microsoft.com/en-us/powershell/gallery/psgallery/psgallery_gettingstarted

      The PowerShell Gallery | MSDN https://msdn.microsoft.com/en-us/powershell/gallery/readme

      There are many more but one will find them through all of the above, for those whom are interested. Also keep a watch on @jsnover on Twitter the Father of Powershell.

      For clarification, I am still a novice BUT I do find PS and PS ISE(for the Module memory joggers) fascinating. However I do prefer GUI’s the most.

      Best Regards,

      Crysta

      --------------------------------------

      1. Tower Totals: 2xSSD ~512GB, 2xHHD 20 TB, Memory 32GB

      SSDs: 6xOS Partitions, 2xW8.1 Main & Test, 2x10.0 Test, Pro, x64

      CPU i7 2600 K, SandyBridge/CougarPoint, 4 cores, 8 Threads, 3.4 GHz
      Graphics Radeon RX 580, RX 580 ONLY Over Clocked
      More perishable

      2xMonitors Asus DVI, Sony 55" UHD TV HDMI

      1. NUC 5i7 2cores, 4 Thread, Memory 8GB, 3.1 GHz, M2SSD 140GB
      1xOS W8.1 Pro, NAS Dependent, Same Sony above.

      -----------------

    • #98216

      OK, I as going about it wrong. Now that I’m using the PROPER way to access it, it works perfectly.

      Thanks ot all for the tips.

      Dave

    • #118480

      Ran SFC /verifyonly on Win 7 SP1 x64 Pro. Got many errors, most of which point to all the files I deleted on one of my cleaning binges. Files are all the unused language files I do not need. Files located in various places in Windows and its sub-directories. Any cause for concern? Why must I keep the unused files of various languages? Did not delete various kbd files, too time consuming to figure out who’s who? Tnx.

    • #319977

      FWIW, I never run any of the Windows tools in the “check” or “analyze” mode, I always run them in their repair mode.  If there’s nothing wrong, I still get the “OK” from the tool, but if there is something wrong, I don’t have to re-launch the tool for a second run.

      If the Dism tool can’t effect repairs (which does happen on occasion) I use my installation media and run this command line:

      dism /online /cleanup-image /restorehealth /source:X:\repairsource\windows /limitaccess

      where X is the drive letter assigned by File Explorer when the media is plugged in.

      Always create a fresh drive image before making system changes/Windows updates; you may need to start over!
      We were all once "Average Users". We all have our own reasons for doing the things that we do with our systems, we don't need anyone's approval, and we don't all have to do the same things.

      1 user thanked author for this post.
    Viewing 14 reply threads
    Reply To: 1000001: Using the System File Checker

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: