How to fix corrupt system files on Windows XP, Vista, 7, and 8 for free [Guide]

Although its rare, every once in a while some Windows system files will become corrupted and report errors. You will be receiving messages of missing DLL files or some other errors indicating that a system file has been corrupted. A restart often fixes the problem but if it doesn’t, you can use the System File Checker which attempts to repair your Windows files while the system is running. Read our guide below to learn how to run System File Checker on Windows XP, Vista, 7, 8, and 8.1 to fix corrupt system files.

How To Fix Corrupt System Files with System File Checker on Windows XP, Vista, 7, 8, and 8.1

Step 1: To get started, search for command prompt from the start menu and open it. Windows Vista and 7 users will have to right click on it and choose “Run as Administrator“. Windows 8 and 8.1 users will have to search for command prompt via Start screen and right-click or long-tip and “Run as Administrator“.

Step1-System-file

Step 2: Once the command prompt window opens, type: sfc /scannow and hit Enter. Make sure that there’s a space between sfc and /scannow .

Step 2

Step 3: Now the system scan will begin scanning for corrupted files and repair it if necessary.

25gwi9f

Step 4: Once the system scan is done, a message will appear whether any system file was corrupted. To exit the command prompt, simply close the window.

done-system-file-checker

Conclusion

The System File Checker scans for any system files or dll errors and attempts to fix it without forcing a system reboot. If you’ve done all virus checks, troubleshooting and defragging and if Windows still reports errors, you can use the System File Checker.

Share this post

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

53 comments

  1. Donna

    Hi, Hoped your solution for file extension corruption would work, but I cannot even open the command prompt window because of the .lnk extension my Windows 7 (Home Premium) has given to everything. I only get prompted to save. It will not open the command prompt, nor notepad. All of a sudden my Windows 7 changed every extension to .lnk. I have AVG and it says I am all protected. All icons in the bottom tray have .lnk and all open in Windows Picture Viewer and say it cannot be displayed. Any advice? Thanks!

  2. mini

    thanx much for the hgst links. turns out my replacement drive, a toshiba, is also identified as hitachi by my system. ironic.

    all seems well with my ‘new’ system. thank you to all for your help.

  3. BearPup

    [@mini]FYI: I had an Hitachi drive that went ‘south’ and I went through WD to get it repaired and they were very responsive, ultimately replacing it with a larger drive when they were out of stock on the exact model.

    My two computer systems all use WD drives (3 out of 3). Again, an FYI.

  4. mini

    your ‘two-cents’ is well taken…

    however, none of the hitachi sites i can find acknowledge the model number for my hard drive, so i’m at a loss to find the appropriate software to test the drive. also, it would seem that hitachi is now associated with western digital — another good reason to pull the drive :)

  5. jmjsquared

    [@mini] Pardon me. I gave you bad info: The HDD Regenerator to which I refer is NOT free but costs $100.00 : http://www.dposoft.net/hdd.html

    The latest File Version is 15.0.0.573 which hasn’t been updated since 2012, I believe.

    My two-cents: If you still have functional access to the suspect drive, run the manufacturer’s disk tool. If that reports ANY errors (except for a very few reallocations, which I consider pre-panic alerts, anyway) Do Not use the drive at ALL. Get a replacement, back up the suspect drive and ONLY then experiment with these or other utilities.

  6. jmjsquared

    [@mini] [@BearPup] Happy to see you guys got things sorted. Hope things stay that way with the “questionable” drive. May I suggest that you go to your hard drive manufacturer’s website and download their disk tool which is best suited to deal with its specific architecture.

    You may also want to take a look at HDD Regenerator, which I think is free, takes forever to run but does an excellent job. There is also SpinRite which costs about $60 with a full money-back guarantee and works miracles.

    Did you do a chkdsk /r on the drive? In any event, I think you are wise to prepare to replace the drive. Once they start hiccupping, it is usually downhill from there.

    Pardon the interruption. :-)

  7. BearPup

    [@mini] A surface scan with or without a repair is only one of a multitude of functions that hard drive programs evaluate. Most drives today are S.M.A.R.T. drives which measure over 100 different functions, any one of which could be the signal of a pending crash, and which the hard drive freeware program I suggested is designed to measure. But I’m sure you already know all that.

  8. mini

    let me assure you i let the repair finish — not a noob.

    i have version 11 of paragon’s partition manager which performs a deep surface scan/repair of any hard drive (and also takes a good amount of time).

  9. BearPup

    [@mini] I’m not sure what you experienced either, unless you hadn’t let the repair finish?

    At any rate, glad things are running better. To check your hard drive’s health let me suggest The Windows Club website and the hard drive examination software the review [http://www.thewindowsclub.com/hdd-expert-download]. The software takes time to go through, but its worth it in your situation. Good luck to you – and feel free to post back here if you have any questions.
    BearPup

  10. mini

    when i tried to perform sfc /scannow during the repair i got a strange message to the effect that a repair was pending and a reboot was required and that i should run sfc after restarting. tried this twice with my win7 disk and got the message twice, but the computer is running better [for now] :)

    i have made back-ups and am prepared to install a new hard drive — hope i don’t have to.

    thanx for your help.

  11. BearPup

    [@mini] You can try to do a repair from inside Windows, that has the sole advantage of repairing your existing installation of Windows. And it was what I tried first. But if it is a hard drive problem, the repair won’t last, as you’ll soon wind up with the same symptoms re-appearing.

    Do you have a system disk? This would be an installation DVD with just Windows 7 on it. If not, you’ll need to make one first. BTW Memtest tests your memory chips, it doesn’t test your hard drive.
    There is some freeware software you can use to determine if it is your hard drive.

  12. mini

    thanx for the fast reply. i have been slightly suspicious about my hard drive ’cause i get 1a blue screens about once a week, although memtest reports everything is find. my biggest headache is that explorer breaks an average of 3-4 times a day. i don’t always report the error, but always have to let explorer re-load.

    do you have any other suggestions before i try the windows repair and/or replace my hard drive?

  13. BearPup

    [@mini] I’m sorry to hear you are in thjat situation. I do volunteer Tech Support at Microsoft, and what we tell people every time they are in that situation is to do a System Repair (not Restore). Do you know how to do that?
    Its also the advice that I followed myself. We determined that it was a failing hard drive was the cause so I pulled the hard drive, bought a new drive, and reinstalled Windows and all my programs from scratch.
    Let me know if you need specific help.
    Regards,
    BearPup

  14. mini

    i keep getting a message that sfc /scannow (running administratively) was unable to fix all errors — even running in safe mode.

    a copy of …\cbs.log was made, but i do not know how to find which corrupt files still need replacing, nor do i know how to accomplish the replacements.

    can you please help ???

  15. BearPup

    @Tom & jmjsquared; My Thanks to both of you. I plan on running the SFC as well as generating the sfcdetails.txt file. I also have some new software to install, mainly product upgrades to existing software; as this has been the bane of this computer it’ll be a good test of the stability of the Windows installation.

  16. jmjsquared

    [@Tom] Thanks. I asked because, I later learned, the DISM command that worked for you does NOT work on versions before Windows 8, OEM or otherwise, which installs a “cleanup-image”.

    To output the SFCDETAILS.TXT file to the Desktop, as posted below, this Command works in Windows 7:
    findstr /c:”[SR]” %windir%\Logs\CBS\CBS.log >”%userprofile%\Desktop\sfcdetails.txt”

  17. Tom

    @BearPup… Here’s how to generate sfcdetails.txt…

    1. Click Start , type cmd in the Start Search box, right-click cmd in the Programs list, and then click Run as administrator. If you are prompted for an administrator password or for a confirmation, type your password, or click Continue.

    2. Type the following command, and then press ENTER:
    findstr /c:”[SR]” %windir%\logs\cbs\cbs.log >sfcdetails.txt

    Then open sfcdetails.txt in Notepad.

    @JMJ… My Win 8.1 (32-bit) came from a Vista upgrade. The 64-bit machine was upgraded from Win8 (OEM).

  18. JMJ

    [@BearPup] I’ve started a topic in the Forum: Using SFC and DISM to Repair and Service Windows 7+ Installations | Tech Support | Forums

    — You must run the command I mentioned below in order to output that .txt file from a CBS.log .

    [@RonC] What operating system are you on? Windows XP, right? None of my Windows 7 installations make that request for a CD/DVD.

    [@Tom] Are your 32bit and 64bit Windows factory installed?

    Which leads me to this: I think the DISM usage suggestions made by Alihassan apply only to systems that have a “clean-up image”, probably created by an OEM installation. I cannot get his commands to run on my systems.

    Note: Curious about DISM which is new to me, I found these GUI’s which may make the tool easier to use: (1) dismgui.codeplex.com ; and (2) datafilehost.com/d/0fb6904b .

    Thanks again, Alihassan Mahdi, for your informative article!

  19. RonC

    I have found that it is necessary to have your original Windows installation disc handy because System File Checker will ask for the source of the files it must repair or replace. I always insert the disc in one of my optical drives before launching the File Checker, so when SFC asks for the location of a file I just point it to the cd/dvd drive containing the Windows disc.

  20. BearPup

    [@jmjsquared] I’m thinking that maybe we ought to move this discussion to the Forum (perhaps Mr. Boss can transfer the comments made to date to a forum thread). In particular I don’t want to lose comment #6 and all of your suggested steps.

    And speaking of your suggestions I tried locating a “Sfcdetails.txt” on my computer and its just not there. I have the one log file “CBS.log” which details the results of the SFC /scannow scan.Personally, I’m not sure what the next step is except move it to the forum. Anybody else care to chime in?

  21. jmjsquared

    [@BearPup] Copy & paste the newest, error-free CBS.log to the Desktop and temporarily replace it with an old, error-containing Log. Once the Bad Log is in the WindowsCBS folder, run the command I mentioned which will output the sfcdetails.txt file to your Desktop. You can then practice with those results. When going thru the exercise of extracting and moving good files from an installation CD/DVD, you can save them to an Experimental Folder, rather than the real locations on your System

    Remember to restore the proper CBS log to its proper place.

  22. Tom

    Hey guys… be sure to bookmark/copy comment #6. It is invaluable. I’ve often found “hash mismatch” errors in CBS.log that SFC was incapable of handling, and “dism” cleared up everything (I’m running Win 8 (32 & 64-bit), FWIW)

    Be patient when it runs. The second command updates the command window infrequently, so you may think its “stuck”. Just have a coffee and wait it out.

    Did I mention copying comment #6… ? Evernote is your friend.

  23. BearPup

    [@jmjsquared] Again, my thanks to you. I’ll need some time to work through your instructions and re-run the SFC command. The one concern I have is that the last 3 times I’ve run SFC, the results have come back clean; while this is great news, it leaves me with this question: If I don’t have the SFC logs from ‘bad’ runs, how do I carry out the instructions you left?

    I do have one SFC log from an earlier SFC run where things weren’t working, but the last 3 times when the run came back clean, I didn’t save anything. I will keep the one ‘bad’ log I do have, and will save subsequent logs, but beyond moving forward and waiting for the next system crash, I’m not sure what else I can do.

  24. jmjsquared

    [@BearPup] You’re welcome. I did not want to intrude on Mags but, since you and I are still awake: Every time you’ve run SFC, a log was written to in Windows\Logs named “CBS.log” . To make it easier to identify any files that SFC did not repair, I do the following:
    Right-click on Notepad and click on “Run as Administrator”. In Notepad, click on File > Open and then navigate to the CBS.log. Select and then delete the entire contents of the log (Not the log itself.) and click Save and then close Notepad. Now, when you next run SFC, only the most recent results will appear in the Log, thereby, making it easier to identify ONLY those files that NOW are in need of repair.

    Now, run SFC /SCANNOW once more and, after it completes, in an elevated Command prompt type:
    findstr /c:”[SR]” %windir%\Logs\CBS\CBS.log >”%userprofile%\Desktop\sfcdetails.txt” exactly as this appears, including quotes. A file named “sfcdetails.txt” will now be on the Desktop of the logged-on User and will identify any corrupt files that could not be repaired.

    Once they have been identified and if you need help beyond the Microsoft article in finding them or restoring them to their proper locations, then, please post back here and we’ll move this to the Forum and get things sorted, once and for all.

  25. BearPup

    [@Mags] Thanks for your detailed posting. After reading through it and the Windows 7 Forum piece you pointed me to, I’m familiar with what you’re saying, and understand the ‘odd’ drive lettering that goes on within versus without Windows. I’m happy to say that I’ve now had two successful scans in a row, and immediately thereafter I made a DOS-level backup image of the C:\ drive and a DVD with my data and programs burned to it.

    The issue that I was referring to happened to me within the last month. For some inexplicable reason I started having trouble installing programs that I knew were safe programs (including one from Shareware on Sale, the sister site of this one). After running a number of diagnostic tests that showed everything was good, I tried the SFC command. The result: Windows found corrupt files that it couldn’t fix. I eventually replaced the hard drive, formatted it, and then reinstalled Windows from scratch.

    What I’m left trying to figure out, without much success, is how one goes about figuring out which files are corrupt, and then finding, re-inflating, and uploading their replacements to the Windows directory?

  26. Goldenbarstewart

    @Alihassan Mahdi – my apologies – your instructions worked perfectly when I switched to the Admin account and ran a command prompt. I was surprised that a problem was repaired – I wasn’t aware there was one. I am running sfc now as per your instructions. Is this program web based? Where does it get the data to compare? Will it work on windows XP?

  27. Goldenbarstewart

    [@Alihassan Mahdi] Alihassan – Unfortunately in Windows 8.1 after entering “dism /online /cleanup-image /restorehealth” the command prompt disappears and nothing seems to happen. In a command prompt window a message appears indicating a higher level of permissions is required to run DISM.

  28. JMJ

    @Alihassan Mahdi – the Command, dism /online /cleanup-image /checkhealth was new to me. So, just for fun, I tried it on a Windows 7 machine from an elevated prompt and I keep getting the error: “The checkhealth option is not recognized in this context.” What am I doing wrong? :(

    Btw, there is another very bright engineer and computer sciences guy, B.A. Mahdi, at Cairo University (I believe). Any relation?

  29. JMJ

    [@Goldenbarstewart] You are going to have to find an XP disc or image. There are legitimate, legal Windows 7 images offered for download at Digital River (or DigitalRiver?) who may also have XP images available. Google them.

    If all else fails, you will have to manually copy good files from a working installation of XP to replace the corrupted files.

    Mags posted a link in Comment #2, below, to an excellent resource that will answer all your questions, as well as walk you through the process.

  30. JMJ

    [@Alihassan Mahdi] Thank you very, very much for your kind replies. Much appreciated, however, I was not asking for myself; rather, I was suggesting what I think would be a good follow-up article for your readers.

    Unfortunately for me, I’ve had too much experience repairing corrupted files SFC found but could not repair by itself. :(

    By the way, in your kind instructions for me, please mention that you MUST start the Windows DVD upgrade process from WITHIN Windows; i.e., while logged on. If you attempt an upgrade at boot, you WILL corrupt/damage the existing installation.

    FYI, there is an superb In-place Upgrade Guide(de facto, in-place repair) at Sevenforums.com
    that, complete as the step-by-step guide is, is still closely and actively monitored by its author.

    Thanks again.

  31. Alihassan Mahdi
    Author/

    If SFC can’t repair some of the corrupted files, try this method:

    Step1 : Enter this into the command prompt : dism /online /cleanup-image /checkhealth

    Step 2 : After the above step is done, type in the following : dism /online /cleanup-image /restorehealth

    This might take up to 10 minutes or more so let it do the work.

    After it’s done, run sfc /scannow in command prompt again as mentioned in the article above.

    Personally, this worked for me. Try it and let me know what happens.

    (Note: I have tried this method on Windows 8 only)

    Another method is to manually replace the corrupted files. I’ll post an article on it soon.

  32. JMJ

    Nice article for the new or technically uninitiated Windows user. Perhaps you will consider writing a follow-up article detailing the steps necessary to replace/repair those files that System File Checker (SFC) could not repair automatically.

  33. Mags

    “The System File Checker scans for any system files or dll errors and attempts to fix it without forcing a system reboot. ”

    Actually it is a good idea to do a reboot, even though it isn’t always necessary, it it better to be safe than sorry.

  34. Mags

    [@BearPup] It has been a long time since I’ve used the SFC/ scannow so couldn’t remember exactly how to do it outside of Windows at boot up. So did a quick search for the info. Hope this helps.

    Try this

    When running sfc /scannow from outside of Windows, like from the Command Prompt available when you boot from your Windows disc or flash drive, or from your System Repair Disc or Recovery Drive, you’ll have to tell the sfc command exactly where Windows exists, as in this example:

    sfc /scannow /offbootdir=d:\ /offwindir=d:\windows

    The /offbootdir= option specifies the drive letter, while the /offwindir= option specifies the Windows path, again including the drive letter.

    Note: Depending on how your computer is setup, the Command Prompt, when used from outside of Windows, doesn’t always assign drive letters in the same way that you see them from inside Windows. In other words, Windows might be at C:\Windows when you’re using it, but D:\Windows from the Command Prompt in System Recovery Options.

    In most installations of Windows 8 and Windows 7, C: usually becomes D: and in Windows Vista, C: is usually still C:. To check for sure, look for the drive with the Users folder on it – that will be the drive Windows is installed on, unless you have multiple installations of Windows on multiple drives.

    If that doesn’t help, or confusing check here http://www.sevenforums.com/tutorials/139810-sfc-scannow-run-command-prompt-boot.html

    Hope this helps.

  35. BearPup

    I’ve recently run into a snag using the SFC command. I ran it, just as you describe, but it came back and said that it couldn’t fix some corrupted files in Windows (7). Any tips for dealing with that situation?

    Also, I did a brand new (starting from formatting the drive) install, and I got the same error message: corrupt files that Windows can’t repair. Any suggestions for dealing with that scenario?

    Any help greatly appreciated.