49

In Windows 7, after running chkdsk C: /F /R and finding out that my hard disk has 24 KB in bad sectors (log is posted below), I decided to run Windows 7's System File Checker utility (sfc /scannow).

SFC showed the ff. message after I ran it: "Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log."

Since the CBS.log file is too large, I ran findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt" (as per Microsoft's KB 928228 article) to only get the log text pertaining to the corrupt files. (log is also posted below)

How do I troubleshoot and repair the corrupted files mentioned by sfc /scannow?

My OS is Windows 7, 64-bit.


chkdsk log

sfc /scannow log

(through findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt")

Note: The full log is at http://pastebin.com/raw.php?i=gTEGZmWj . I've only quoted parts of the full log below (mostly from the last part), as the full log won't fit within the character limit for questions. I've added it to serve as a preview.

...
2013-12-28 19:37:50, Info  CSI00000542 [SR] Beginning Verify and Repair transaction
2013-12-28 19:37:55, Info  CSI00000544 [SR] Verify complete
2013-12-28 19:37:56, Info  CSI00000545 [SR] Verifying 95 (0x000000000000005f) components
2013-12-28 19:37:56, Info  CSI00000546 [SR] Beginning Verify and Repair transaction
2013-12-28 19:38:03, Info  CSI00000548 [SR] Verify complete
2013-12-28 19:38:03, Info  CSI00000549 [SR] Repairing 43 (0x000000000000002b) components
2013-12-28 19:38:03, Info  CSI0000054a [SR] Beginning Verify and Repair transaction

...
  
2013-12-28 19:38:15, Info  CSI0000075d [SR] Could not reproject corrupted file [ml:520{260},l:84{42}]"\??\C:\Windows\System32\migwiz\dlmanifests"\[l:38{19}]"IasMigPlugin-DL.man"; source file in store is also corrupted
2013-12-28 19:38:15, Info  CSI00000760 [SR] Could not reproject corrupted file [ml:520{260},l:84{42}]"\??\C:\Windows\System32\migwiz\dlmanifests"\[l:50{25}]"International-Core-DL.man"; source file in store is also corrupted
2013-12-28 19:38:16, Info  CSI00000762 [SR] Cannot repair member file [l:24{12}]"wbemdisp.dll" of Microsoft-Windows-WMI-Scripting, Version = 6.1.7600.16385, pA = PROCESSOR_ARCHITECTURE_INTEL (0), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch
2013-12-28 19:38:16, Info  CSI00000763 [SR] This component was referenced by [l:202{101}]"Microsoft-Windows-Foundation-Package~31bf3856ad364e35~amd64~~6.1.7601.17514.WindowsFoundationDelivery"
2013-12-28 19:38:16, Info  CSI00000766 [SR] Could not reproject corrupted file [ml:58{29},l:56{28}]"\??\C:\Windows\SysWOW64\wbem"\[l:24{12}]"wbemdisp.dll"; source file in store is also corrupted
2013-12-28 19:38:16, Info  CSI00000768 [SR] Cannot repair member file [l:56{28}]"Microsoft.MediaCenter.UI.dll" of Microsoft.MediaCenter.UI, Version = 6.1.7601.17514, pA = PROCESSOR_ARCHITECTURE_MSIL (8), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch
2013-12-28 19:38:16, Info  CSI00000769 [SR] This component was referenced by [l:176{88}]"Microsoft-Windows-MediaCenter-Package~31bf3856ad364e35~amd64~~6.1.7601.17514.MediaCenter"
2013-12-28 19:38:16, Info  CSI0000076c [SR] Could not reproject corrupted file [ml:520{260},l:40{20}]"\??\C:\Windows\ehome"\[l:56{28}]"Microsoft.MediaCenter.UI.dll"; source file in store is also corrupted
2013-12-28 19:38:16, Info  CSI0000076e [SR] Cannot repair member file [l:24{12}]"ReAgentc.exe" of Microsoft-Windows-WinRE-RecoveryTools, Version = 6.1.7601.17514, pA = PROCESSOR_ARCHITECTURE_INTEL (0), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch
2013-12-28 19:38:16, Info  CSI0000076f [SR] This component was referenced by [l:202{101}]"Microsoft-Windows-Foundation-Package~31bf3856ad364e35~amd64~~6.1.7601.17514.WindowsFoundationDelivery"
2013-12-28 19:38:16, Info  CSI00000772 [SR] Could not reproject corrupted file [ml:48{24},l:46{23}]"\??\C:\Windows\SysWOW64"\[l:24{12}]"ReAgentc.exe"; source file in store is also corrupted
2013-12-28 19:38:16, Info  CSI00000774 [SR] Cannot repair member file [l:82{41}]"System.Management.Automation.dll-Help.xml" of Microsoft-Windows-PowerShell-PreLoc.Resources, Version = 6.1.7600.16385, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture = [l:10{5}]"en-US", VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch
2013-12-28 19:38:16, Info  CSI00000775 [SR] This component was referenced by [l:266{133}]"Microsoft-Windows-Client-Features-Package~31bf3856ad364e35~amd64~en-US~6.1.7601.17514.Microsoft-Windows-Client-Features-Language-Pack"
2013-12-28 19:38:16, Info  CSI00000778 [SR] Could not reproject corrupted file [ml:520{260},l:104{52}]"\??\C:\Windows\System32\WindowsPowerShell\v1.0\en-US"\[l:82{41}]"System.Management.Automation.dll-Help.xml"; source file in store is also corrupted
2013-12-28 19:38:16, Info  CSI0000077a [SR] Cannot repair member file [l:18{9}]"hlink.dll" of Microsoft-Windows-HLink, Version = 6.1.7600.16385, pA = PROCESSOR_ARCHITECTURE_INTEL (0), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch
2013-12-28 19:38:16, Info  CSI0000077b [SR] This component was referenced by [l:202{101}]"Microsoft-Windows-Foundation-Package~31bf3856ad364e35~amd64~~6.1.7601.17514.WindowsFoundationDelivery"
2013-12-28 19:38:16, Info  CSI0000077e [SR] Could not reproject corrupted file [ml:48{24},l:46{23}]"\??\C:\Windows\SysWOW64"\[l:18{9}]"hlink.dll"; source file in store is also corrupted
2013-12-28 19:38:16, Info  CSI00000780 [SR] Repair complete
2013-12-28 19:38:16, Info  CSI00000781 [SR] Committing transaction
2013-12-28 19:38:19, Info  CSI00000785 [SR] Verify and Repair Transaction completed. All files and registry keys listed in this transaction  have been successfully repaired
2
  • the log only shows what I already told you. repair Windows with the Inplace upgrade. Commented Dec 29, 2013 at 20:19
  • @magicandre1981 I've read your answer. I'll provide feedback once I have tried it. I included the logs (which was already there in the original post) to help other potential answers in providing possible solutions. Commented Dec 30, 2013 at 1:34

8 Answers 8

14

The only way to fix this large amount of corrupted files in Windows 7 is to do a repair installation/Inplace upgrade.

  • Insert your Windows 7 DVD or mounted a Windows 7 ISO
  • Run setup.exe from the DVD/mounted ISO
  • during setup select upgrade

enter image description here

This repairs Windows but keeps are programs.

In 2015, Microsoft backported a DISM command from Windows 8 to Windows 7 to repair files. Look if it is possible to install the update KB2966583, open a command prompt as admin and run DISM /Online /Cleanup-Image /Scanhealth to try to repair files. But if this fails, try the inplace upgrade. Still is still the best option for Windows 7 to make sure it gets fully repaired.

6
  • But we can copy C:\Windows\System32\dism.exe over to Windows 7 and it would work fine right?
    – Pacerier
    Commented Apr 24, 2015 at 2:34
  • 1
    This doesn't work if the Users\ or the Program Files\ folder is not on the system drive. :(
    – Kai
    Commented Jun 21, 2015 at 4:17
  • @Kai this is correct. Moving those folders is not supported by Microsoft. Commented Jun 21, 2015 at 5:35
  • no, it's not the only way to do a windows repair from install media, i gave alternative and simple solution. Commented Mar 4, 2017 at 18:58
  • @Pacerier MS backported the scanHealth command to Win7, here it works like RestoreHealth in win8, but you can only use /Online, not against an image. Commented Mar 5, 2017 at 7:51
3

Run chkdsk C: /F /R from the Windows installation DVD,

  1. Boot from Windows 7 DVD.
  2. Select "Repair Your Computer".
  3. Choose your target system.
  4. In the recovery tool panel, choose Command Prompt.
  5. Run chkdsk <your target drive>/: /F /R

When you run check disk from the installation DVD, windows will try to recover corrupted files and fix them.

I have tried it and it works every time.

2
  • Thanks so much, Mohannd. Your answer solved my Windows Resource Protection found corrupt files but was unable to fix some of them error.
    – Miles
    Commented Jul 27, 2015 at 1:55
  • 1
    Sorry to update my previous comment here; the 5 minute edit window had sadly closed. Here's the rest: Running chkdsk from the Windows 7 DVD concluded with (Failed to transfer logged messages to the event log with status 50), but apparently that is normal. Thanks also to @galacticninja for asking the question!
    – Miles
    Commented Jul 27, 2015 at 2:03
2

If sfc /scannow doesn't work, try this command when running Windows 8:

dism /Online /Cleanup-Image /RestoreHealth

or this command if you are in repair mode of Windows 8 DVD/USB:

Dism /Image:C:\ /Cleanup-Image /RestoreHealth

provided that the broken Windows 8 is on partition C:.

3
  • Although you answer mentions Win 8 the steps are the same for Win 7.
    – Kinnectus
    Commented Jun 17, 2014 at 15:14
  • 5
    @BigChris and niutech: This doesn't seem to work on Windows 7. I'm getting the ff. error message with the first command: Error: 87 — The restorehealth option is not recognized in this context. — For more information, refer to the help. — The DISM log file can be found at C:\Windows\Logs\DISM\dism.log Do you know the counterpart commands for Windows 7? Commented Jun 18, 2014 at 6:10
  • 7
    From technet.microsoft.com/en-gb/library/hh824869.aspx: "The DISM /ScanHealth, /CheckHealth, and /RestoreHealth arguments can only be used when servicing Windows® 8 or Windows Server® 2012 images." Commented Aug 2, 2014 at 10:48
1

In Windows 7 and later, SFC's component database is maintained by Windows Update. Running Windows Update will trigger automated repair of the component database, after which you may have more luck with SFC.

2
  • no, it wont, it will not fix winsxs, see the solution i posted. Commented Mar 4, 2017 at 3:53
  • 3
    @GeorgeDima you may be able to appreciate that there is more than one possible reason for a particular problem.
    – DustWolf
    Commented Mar 4, 2017 at 20:42
1

Although it is possible to repair system files through an upgrade (as detailed above), you should consider whether you really want to do so. If the system file corruption was caused by bad sectors, it's likely that your hard drive is starting to fail. You may not have any more problems for some time, but how long might it be before you experience more corruption? It was system files this time, perhaps it'll be your personal data next time. I would recommend backing up all your data, getting either a new computer or a new hard drive, and then restoring your data onto it. Though more expensive, it's safer in the long run.

2
  • 2
    This is only tangentially related to my question, and IMO, is more of a comment and less of an answer. But as a reply to your post, yes, I have indeed made a backup of my important files, and will be replacing the hard drive as soon as I am able to. My hard drive still has life left to it though, as I am still using it daily and no more bad sectors have arised. Commented Aug 24, 2014 at 16:53
  • Its worth taking into account when deciding what to do though. In the longer term, bad sectors and corrupted data is a sign something is wrong, and backing up and replacing the drive is probably the smart thing, even if its not an answer the OP wants to hear.
    – Journeyman Geek
    Commented Aug 25, 2014 at 0:46
1

If SFC /SCANNOW doesn't work, try running it with the computer in SAFE MODE. Make sure that the PendingDeletes and PendingRenames folders exist under %WinDir%\WinSxS\Temp and that they are empty. If not, delete the contents and run SFC /SCANNOW again. See http://support.microsoft.com/kb/929833 for more info.

3
  • 1
    Is anyone able to confirm that it is safe to delete the contents of the PendingDeletes and PendingRenames folders? I saw someone say this can break the OS beyond repair (they didn't cite a source).
    – Tom
    Commented Mar 13, 2016 at 5:17
  • This worked for Windows 8.1, and I didn't even have to check Pending* directories.
    – Chloe
    Commented Oct 27, 2016 at 6:11
  • @Tom no do not delete them, the source link that WeHoChris has provided, it says make sure that the PendingDeletes and PendingRenames folders exist under %WinDir%\WinSxS\Temp. but it doesn't say that you should delete them.
    – Shayan
    Commented Nov 5, 2019 at 17:45
0

One other thing to try is to install the CheckSUR tool from Microsoft: https://support.microsoft.com/en-us/kb/947821

"SUR" stands for "System Update Readiness".

Its purpose is to repair corrupted system files. (That is: it replaces them with a good copy.) Its name suggests that it's been created for cases when system update wouldn't run, and that it only checks, but in fact it also fixes problems. I don't know whether it only fixes a subset of system files necessary for the update to succeed, or all of them. Perhaps folks who run into this problem can try it, then run SFC again, and let us know if the error went away?

This is for Windows Vista and 7. In Windows 8 it's already installed, and it has been renamed into Deployment Image Servicing and Management (DISM). Hopefully it's not as dismal as it sounds.

2
  • so'how to use dsim in that way in windows 8? Commented Jan 3, 2016 at 19:46
  • windows update installer has nothing to do with repairing Winsxs. Commented Mar 4, 2017 at 18:56
-2

best method for Windows 7 , manually copy missing files, i did it today, had 5 files to copy, no SFC error after.

source is in $install_media/source/install.wim . Open with 7-zip and it has the same structure as the windows partition, so copy from the corresponding folder.

6
  • 1
    the chances are high that the users mix 32 & 64 bit files and this causes errors. don't do it Commented Mar 5, 2017 at 7:42
  • you did not understand, my solution is failsafe, since you cannot mix any file, you just copy it to the same folder in your current windows install. And you cannot mix 32 with 64 since there are in different folders (syswow64/system32). Commented Mar 5, 2017 at 12:22
  • 3
    no, you can still get issues. the install.wim includes the RTM data. if you have installed updates, the data are newer and you replace them with RTM files and this also causes issues. don't do this quick & dirty crap. repair install/inplace upgrade keeps all settings ;) Commented Mar 7, 2017 at 17:26
  • wrong, if you do Windows repair from install media it will copy the files from the media, which are original not updated ones. and will also replace files that are already good. using my method you could just copy the missing files (reported by SFC) and all will be fine. Commented Mar 8, 2017 at 22:32
  • 1
    no, i get your point, but in my case it worked, it was a simpler solution than reseting windows with a disk repair , and also SFC /scanow reports versions of the missing files, and in my case all of them were never updated by Windows Update, because just a few system files have updates in the Windows timeline, most of them remains stock version for lifetime. Commented Mar 9, 2017 at 23:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .