System Files - SFC Command

ByLine
How to Repair and Verify the Integrity of Vista System Files with System File Checker
Synopsis
System File Checker (SFC) checks that all Vista files are where they should be and that they are uncorrupted. This will show you how to verify and repair the integrity of Vista system files with the System File Checker (SFC) command codes.
How to Repair and Verify the Integrity of Vista System Files with System File Checker

information   Information
System File Checker (SFC) checks that all Vista system files are where they should be as they were by default and not corrupted, changed, or damaged. This will show you how to verify and repair the integrity of Vista system files with the System File Checker (SFC) command codes.
Tip   Tip
If SFC Cannot Finish or Repair a File:
NOTE:
This is for when after you run the SFC scan below, it cannot finish or repair a file. There is no guarantee that SFC can repair the system files if they are corrupted or damaged to much. If SFC still cannot repair them after this, then you might try running Check Disk (chkdsk), System Restore, a Repair Installation, or a clean reinstall of Vista.

1. How to Read the CBS.LOG
NOTE:
When SFC runs, it logs it's actions to the C:\WINDOWS\LOGS\CBS\CBS.LOG. You can find the specific SFC entries by searching for the [SR] tags in the log.
A) For how to see only the SFC scan details in the CBS.LOG:​
  • Open a elevated command prompt.
  • Copy and paste the command below into the elevated command prompt and press Enter.
    Code:
    findstr /c:"[SR]" %windir%\logs\cbs\cbs.log >%userprofile%\Desktop\sfcdetails.txt
  • Close the elevated command prompt.
  • Click on the sfcdetails.txt file that was just placed on your desktop to see the SFC scan details (ones with the [SR] tags) in the CBS.LOG.
  • You can safely delete the sfcdetails.txt file afterwards if you like.
2. Replace the Files that SFC Cannot Fix
NOTE:
If SFC cannot fix a file, it will be listed in the CBS.LOG above. Read the CBS.LOG to find out what file it is so you can replace it with a good copy.
A) For how, see:​
warning   Warning
Be aware that if you have modified your system files as in theming explorer/system files, running sfc/scannow will revert the system files such as explorer.exe back to it's default state. Make the appropriate backups of your system files that you have modified for theming if you wish to save them before running sfc/scannow.




Here's How:
NOTE:
If sfc cannot start or finish, then try running it Safe Mode.
2. In the elevated command prompt, type the command that you want to do in bold below in steps A to E to run System File Check.​
A) sfc /scannow - Scans the integrity of all protected system files and repairs the system files if needed. (See screenshot below)​
NOTE: Restores Vista's original setup of system files. (EX: Fonts, wallpapers, System32 files, etc.)
scannow.jpg

B) sfc /verifyonly - Scans and only verifies the integrity of all proteced system files only. (See screenshot below)​
NOTE: If it finds anything like in the screenshot below boxed in red at the bottom, you should run step A to see if it can fix it. See how to read the CBS log above for details on the SFC scan results.​
verifyonly.jpg

C) sfc /scanfile=(full path of file) - Scans the integrity of the chosen system file and repairs it if needed.​
EX: sfc /scanfile=C:\Windows\System32\kernel32.dll​
D) sfc /verifyfile=(full path of file) - Scans and only verifies the integrity of the chosen system file.​
EX: sfc /verifyfile=C:\Windows\System32\kernel32.dll​
E) sfc /? - For a list of all sfc command codes with description. (see screenshot below)​
SFC_Help.jpg


3. Press Enter.​
NOTE: It may take a while to finish.​
4. Close the elevated command prompt when it finishes.​
5. If you got a message to restart the computer in the command prompt, then restart the computer to finish the repair.​

Note   Note
If SFC could not fix something, then run the command again to see if it may be able to the next time. Sometimes it may take running the sfc /scannow command 3 times restarting the PC after each time to completely fix everything that it's able to.

If not, then download and run the 32-bit (x86) or 64-bit (x64) System Update Readiness Tool for your same installed 32-bit or 64-bit Vista, restart the PC afterwards, and try the sfc /scannow command again.

If still not, then you can attempt to run a System Restore using a restore point dated before the bad file occured to fix it. You may need to repeat doing a System Restore until you find a older restore point that may work.

If still not, then you can use the steps in the yellow TIP box at the top of the tutorial to manually replace the files that SFC could not fix.




That's it,
Shawn


Related Tutorials



 
Last edited by a moderator:
Shawn Brink

Comments

You're welcome Canukistani, and welcome to Seven Forums.

It will not hurt anything since you are not using it. If it causes you any problems though, then please let us know and we shall try and help with it. :)
 
Thank you for all the hard work Brink. I did the SFC Commanf for the first time today. I just followed the instruction as you listed them. It took a few min. but the results were great, no problems. Again thank you.
 
Thanks for your clear instructions Brink. I have a question for you - I completed the sfc /scannow and there were two items that could not be repaired that dealt with the Windows Sidebar. I have disabled the Sidebar from opening on startup. Could that be the reason that these could not be repaired? I enabled the Sidebar to see if it works and it does - if I don't want to use the Sidebar do these files still need to be repaired?


[SR] Cannot repair member file [l:24{12}]"settings.ini" of Microsoft-Windows-Sidebar, Version = 6.0.6002.18005, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch
2010-04-10 20:23:52, Info CSI 00000167 [SR] Cannot repair member file [l:24{12}]"settings.ini" of Microsoft-Windows-Sidebar, Version = 6.0.6002.18005, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch
2010-04-10 20:23:52, Info CSI 00000168 [SR] This component was referenced by [l:162{81}]"Package_17_for_KB948465~31bf3856ad364e35~amd64~~6.0.1.18005.948465-60_neutral_GDR"



[SR] Cannot repair member file [l:24{12}]"settings.ini" of Microsoft-Windows-Sidebar, Version = 6.0.6002.18005, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch
2010-04-10 20:23:52, Info CSI 00000167 [SR] Cannot repair member file [l:24{12}]"settings.ini" of Microsoft-Windows-Sidebar, Version = 6.0.6002.18005, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch
2010-04-10 20:23:52, Info CSI 00000168 [SR] This component was referenced by [l:162{81}]"Package_17_for_KB948465~31bf3856ad364e35~amd64~~6.0.1.18005.948465-60_neutral_GDR"
 
I tried it again with the Sidebar open and got a third error, they all appear to be identical.

Thanks for your help.


P.S. I just want to add that the system usually starts up fine, noticed that during startup repair a week ago (had a bad software install) it failed the system file integrity test.

This is what's in the settings.ini file:

[Root]
SettingsVersion=00.00.00.01
SidebarShowState=Imploded
SidebarDockedPartsOrder=0x1,0x2,0x3,
Section0=1
Section1=2
Section2=3
Section3=4
Section4=5
[Section 1]
PrivateSetting_GadgetName=%PROGRAMFILES%\windows sidebar\gadgets\Clock.gadget
PrivateSetting_Enabled=true
[Section 2]
PrivateSetting_GadgetName=%PROGRAMFILES%\windows sidebar\gadgets\SlideShow.Gadget
PrivateSetting_Enabled=true
[Section 3]
PrivateSetting_GadgetName=%PROGRAMFILES%\windows sidebar\gadgets\RSSFeeds.Gadget
PrivateSetting_Enabled=true
loadFirstTime=defaultGadget

[Section 4]
PrivateSetting_GadgetName=%25USERPROFILE%25%5CAppData%5CLocal%5CMicrosoft%5CWindows%20Sidebar%5CGadgets%5CaolSonyDailyScoop.gadget
PrivateSetting_Enabled=true
[Section 5]
PrivateSetting_GadgetName=%25USERPROFILE%25%5CAppData%5CLocal%5CMicrosoft%5CWindows%20Sidebar%5CGadgets%5CaolSonySearch.gadget
PrivateSetting_Enabled=true
 
Last edited:
Hi, good directions and Iwas able to do everything as instructed. When I opened deskfile for log as there was problems according to the scan, the folder was empty! Help, now I don't know what to do. Thanks everyone,
 
Last edited:
Hello Cinnabun, and welcome to Vista Forums.

Try creating the sfcdetails.txt file from the yellow TIP box again. You may have made a mistake the first time giving you the empty file. I've updated the instructions to make it bit easier with copying and pasting the command instead of typing it.

Hope this helps,
Shawn
 
Shawn, Thank you for replying so fast. I tried getting the file several times and it still comes up empty. I can copy but can't get it to paste into the command prompt window, it will paste on another page so I know the copy and paste works. Tried to drag and drop also, no go there too! I am probably missing something, but can't seem to figure how to solve this one. Usually I can keep at it long enough and I can get the solution but I have been trying to find and fix whatever this problem is for days. My back up and system restore are failing when I try to use them. Got to keep trying till I really mess this machine up or find a solution! I do like this forum. Thanks again, any more suggestions?
Linda
 
I did the command prompt but this what i got 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. for example C:\windows\Logs\CBS\CBS.log What do i do next .


Thanks Pretteyes45
 
Hello Prettyeyes,

If you are having issues in Vista with these files, then you can do what's in the yellow TIP box at the top of the tutorial to find out which files could not be repaired in the CBS.log and how to replace them.

If not, then I would not worry about them.

Hope this helps,
Shawn
 
I did the command prompt but this what i got 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. for example C:\windows\Logs\CBS\CBS.log What do i do next .


Thanks Pretteyes45
Hello!

If you could please upload the sfcdetails.txt and sxstrace.txt files in your thread as I showed you how to, we can look at it for you and offer advice. I understand that your issue is frustrating and difficult, but if you could please follow the guidelines I posted in your thread, then we should be able to get you back onto your feet.

Thanks!
 
You're most welcome watergirlhawaii, and welcome to Vista Forums. I'm glad it turned out to be nothing serious. :)
 
Welcome
If things go as they should, you should not lose your stuff. That being said, anything can and will often happen. I would back up all my important stuff. Maybe, even better, download the free Macrium Reflect and you can use the image to restore everything in case you experience unanticipated problems.
http://www.sevenforums.com/tutorials/73828-imaging-free-macrium.html
In fact everyone should have a current image on Macrium (on an external hard drive) in the event of unforseen, but major problems. It has even saved me once when updates borked my system.
You should always have a back up of your important stuff. It is impossible to know when the unexepected will happen. You do not have to perform a repair install to experience the loss of important documents.
 
Last edited:
Top