How do I repair the corrupted files found by sfc /scannow? "Windows Resource Protection found corrupt files but was unable to fix some of them."

48

16

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

galacticninja

Posted 2013-12-29T02:27:43.843

Reputation: 5 348

the log only shows what I already told you. repair Windows with the Inplace upgrade. – magicandre1981 – 2013-12-29T20:19:44.773

@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. – galacticninja – 2013-12-30T01:34:20.107

Answers

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.

magicandre1981

Posted 2013-12-29T02:27:43.843

Reputation: 86 560

But we can copy C:\Windows\System32\dism.exe over to Windows 7 and it would work fine right? – Pacerier – 2015-04-24T02:34:02.950

1This doesn't work if the Users\ or the Program Files\ folder is not on the system drive. :( – Kai – 2015-06-21T04:17:02.980

@Kai this is correct. Moving those folders is not supported by Microsoft. – magicandre1981 – 2015-06-21T05:35:12.180

no, it's not the only way to do a windows repair from install media, i gave alternative and simple solution. – George Dima – 2017-03-04T18:58:49.680

@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. – magicandre1981 – 2017-03-05T07:51:49.593

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.

Mohannd

Posted 2013-12-29T02:27:43.843

Reputation: 187

Thanks so much, Mohannd. Your answer solved my Windows Resource Protection found corrupt files but was unable to fix some of them error. – Miles Wolbe – 2015-07-27T01:55:29.503

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 Wolbe – 2015-07-27T02:03:58.687

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:.

niutech

Posted 2013-12-29T02:27:43.843

Reputation: 61

7

From http://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."

– Luke Girvin – 2014-08-02T10:48:26.583

Although you answer mentions Win 8 the steps are the same for Win 7. – Kinnectus – 2014-06-17T15:14:25.377

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? – galacticninja – 2014-06-18T06:10:33.733

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.

DustWolf

Posted 2013-12-29T02:27:43.843

Reputation: 527

no, it wont, it will not fix winsxs, see the solution i posted. – George Dima – 2017-03-04T03:53:26.413

3@GeorgeDima you may be able to appreciate that there is more than one possible reason for a particular problem. – DustWolf – 2017-03-04T20:42:39.357

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.

Marionumber1

Posted 2013-12-29T02:27:43.843

Reputation: 19

2This 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. – galacticninja – 2014-08-24T16:53:42.943

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 – 2014-08-25T00:46:13.417

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.

WeHoChris

Posted 2013-12-29T02:27:43.843

Reputation: 19

1Is 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 – 2016-03-13T05:17:53.747

This worked for Windows 8.1, and I didn't even have to check Pending* directories. – Chloe – 2016-10-27T06:11:14.363

@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 – 2019-11-05T17:45:24.167

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.

Evgeni Sergeev

Posted 2013-12-29T02:27:43.843

Reputation: 1 704

so'how to use dsim in that way in windows 8? – user2284570 – 2016-01-03T19:46:45.803

windows update installer has nothing to do with repairing Winsxs. – George Dima – 2017-03-04T18:56:04.187

-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.

George Dima

Posted 2013-12-29T02:27:43.843

Reputation: 328

1the chances are high that the users mix 32 & 64 bit files and this causes errors. don't do it – magicandre1981 – 2017-03-05T07:42:20.863

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). – George Dima – 2017-03-05T12:22:06.410

3no, 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 ;) – magicandre1981 – 2017-03-07T17:26:36.800

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. – George Dima – 2017-03-08T22:32:00.283

yes, here all files get same consistent level, afterwords, use Windows updtae to get all updates. you produce a Windows which is an inconsistent state, because you mix update levels. Is this so hard to understand? – magicandre1981 – 2017-03-09T16:26:57.247

1no, 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. – George Dima – 2017-03-09T23:06:28.993