Over the past few weeks I have experienced several interesting problems between my two computers. Of particular note was an issue I discovered when the Event Viewer on my Windows 7 Ultimate 32-bit machine failed. After some troubleshooting I decided to attempt SFC /scannow. I got the error message "Windows Resource Protection could not perform the requested operation." This worried me. So I attempted to boot into WinRE from my Win 7 installation disk. The result in WinRE was the same. No good.
I scrounged forum after forum looking for an answer, but nothing worked. It seemed like everyone just gave up and reinstalled their OS, but I would not do that. So I kept exploring. CBS.log showed nothing of interest as sfc never made it past "Beginning verification phase of system scan."
Finally I found this article: http://www.updatexp.com/scannow-sfc.html which, while interesting and comprehensive, did not directly solve my issue. It did, however, point me to the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath
This registry entry does not appear to exist in Win 7, but another entry in it's vicinity caught my attention:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir
I had recently moved my program files dir to a different hard drive and placed a junction point in it's place. In the process I had altered HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir to point to "D:\Program Files\", then back to "C:\Program Files\" when the junction point was in place.
"C:\Program Files\" is incorrect!
the trailing backslash is incorrect, and must be removed!
with the ProgramFilesDir value set to "C:\Program Files" I ran sfc /scannow and it scanned properly, finding several corrupt files (some of which required checking cbs.log to repair).
I can imagine that some virus maker somewhere will use this to break SFC in the future, but here's your solution!
So to review: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir cannot have a trailing backslash!
Tell your friends! :)
Cheers,
Crosmanrond