News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • 1000001: Using the System File Checker

    Home Forums Knowledge Base 1000001: Using the System File Checker

    Viewing 15 reply threads
    • Author
      Posts
      • #83021 Reply
        woody
        Da Boss

        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

        Attachments:
        10 users thanked author for this post.
      • #83189 Reply
        anonymous
        Guest

        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 Reply
          PhotM
          AskWoody Plus

          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 Reply
        grumpy65867
        AskWoody Plus

        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 Reply
          Noel Carboni
          AskWoody_MVP

          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 Reply
        PhotM
        AskWoody Plus

        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 Reply
        b
        AskWoody Plus

        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 10 Pro Version 2004: Group ASAP (chump/pioneer)

        1 user thanked author for this post.
        • #83868 Reply
          Noel Carboni
          AskWoody_MVP

          Thanks. That was a mental parity error – I’ve changed the wording.

          -Noel

      • #83881 Reply
        ch100
        AskWoody_MVP

        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 Reply
          PhotM
          AskWoody Plus

          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 Reply
        Steve S.
        AskWoody Plus

        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”… 😉

        Win7 Pro x64(Group B), Win10 Pro x64 1909, Win10 Home 1909, Linux Mint + a cat with 'tortitude'.

        1 user thanked author for this post.
      • #84364 Reply
        WildBill
        AskWoody Plus

        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.

        Windows 8.1, 64-bit, back in Group A... & leaning toward Windows 10 V2004. As long as it's a Lot Less Buggy!
        Wild Bill Rides Again...

      • #84649 Reply
        Canadian Tech
        AskWoody_MVP

        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 Reply
        Pepsiboy
        AskWoody Lounger

        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 Reply
          Canadian Tech
          AskWoody_MVP

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

          CT

        • #90638 Reply
          WildBill
          AskWoody Plus

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

          Windows 8.1, 64-bit, back in Group A... & leaning toward Windows 10 V2004. As long as it's a Lot Less Buggy!
          Wild Bill Rides Again...

        • #94145 Reply
          PKCano
          Da Boss

          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 Reply
        Pepsiboy
        AskWoody Lounger

        Canadian Tech,

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

        Dave

      • #89506 Reply
        Pepsiboy
        AskWoody Lounger

        PKCano,

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

        Dave

      • #90692 Reply
        PhotM
        AskWoody Plus

        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 Reply
        Pepsiboy
        AskWoody Lounger

        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 Reply
        _Reassigned Account
        AskWoody Lounger

        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 Reply
        bbearren
        AskWoody MVP

        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.

        Create a fresh drive image before making system changes/Windows updates, in case you need to start over!
        "When you're troubleshooting, start with the simple and proceed to the complex."—M.O. Johns
        "Experience is what you get when you're looking for something else."—Sir Thomas Robert Deware

        1 user thanked author for this post.
    Viewing 15 reply threads

    Please follow the -Lounge Rules- no personal attacks, no swearing, and politics/religion are relegated to the Rants forum.

    Reply To: 1000001: Using the System File Checker

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