Windows Vista Forums

System Files - SFC Command

  1. #1
    System Files - SFC Command

    System Files - SFC Command
    How to Repair and Verify the Integrity of Vista System Files with System File Checker
    System Files - SFC Command

    Published by


    Brink's Avatar
    Administrator

    Join Date: Apr 2007
    Location: Texas, USA
    Posts: 31,527

    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.
    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.
    1. Open a elevated command prompt.

    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


  2. #1


    Join Date : Nov 2007
    Posts : 2
    Vista Home Premium 64bit
    Local Time: 09:28

    Re: System Files

    brink just to say thanks ,this solved a problem i had for a long while. ta, peter

      My System SpecsSystem Spec

  3. #2
    Brink's Avatar

    Join Date : Apr 2007
    Texas, USA
    Posts : 31,527
    64-bit Windows 10 build 10074
    Local Time: 04:28
    usa us oklahoma

      Thread Starter

    Re: System Files

    Your welcome Peter,

    Welcome to the forum.

    Glad it solved your problem.

    Shawn

      My System SpecsSystem Spec

  4. #3


    Join Date : Dec 2007
    Posts : 6
    vista home premium x64
    Local Time: 09:28


     

    Re: System Files

    i followed your guide as i keep getting all kinds of alerts telling me that processes are shutting down. I did the scannow and the result said that there were errors but these could not be fixed. the results were saved in the log files.

    So i at least now know there are errors but still can't fix them. Does this now mean i need to do a repair install?

    Many Thanks

    Sean

      My System SpecsSystem Spec

  5. #4
    Brink's Avatar

    Join Date : Apr 2007
    Texas, USA
    Posts : 31,527
    64-bit Windows 10 build 10074
    Local Time: 04:28
    usa us oklahoma

      Thread Starter

    Re: System Files

    Hi Sean (hypno),

    Yes.

    A repair install would be alot easier that digging through the CBS.log file and then manually reinstalling each corrupted file one by one though.

    Have a great New Years,
    Shawn

      My System SpecsSystem Spec

  6. #5


    Join Date : Dec 2007
    Alberta
    Posts : 4
    Vista Ultimate 32b
    Local Time: 03:28
    canada ca alberta

     

    Re: System Files

    Quote Originally Posted by brink View Post
    Hi Sean (hypno),

    Yes.

    A repair install would be alot easier that digging through the CBS.log file and then manually reinstalling each corrupted file one by one though.

    Have a great New Years,
    Shawn

    Quick question, same problem here.
    But before I go off and do something that might make me hang myself

    Doing a repair install, does it keep all my present settings?
    I won't lose anything? (Hope that's the case)

      My System SpecsSystem Spec

  7. #6
    Brink's Avatar

    Join Date : Apr 2007
    Texas, USA
    Posts : 31,527
    64-bit Windows 10 build 10074
    Local Time: 04:28
    usa us oklahoma

      Thread Starter

    Re: System Files

    Hi JohnLug,

    You will need to backup your email messages and settings, but you should always backup anything you do not want to lose just in case something goes wrong.

    Shawn

      My System SpecsSystem Spec

  8. #7


    Join Date : Dec 2007
    Alberta
    Posts : 4
    Vista Ultimate 32b
    Local Time: 03:28
    canada ca alberta

     

    Re: System Files

    Dang, was hoping it would be a quick, easy thing.

    Oh well, I'll have my new HD in a week or so and before doing anything, I'll backup everything.

      My System SpecsSystem Spec

  9. #8
    Brink's Avatar

    Join Date : Apr 2007
    Texas, USA
    Posts : 31,527
    64-bit Windows 10 build 10074
    Local Time: 04:28
    usa us oklahoma

      Thread Starter

    Re: System Files

    JohnLug,

    For me all I lost was my Windows Mail stuff. It was no big deal for me, but I would feel bad if something went wrong with the install and you lost everything.

    Shawn

      My System SpecsSystem Spec

  10. #9


    Join Date : Dec 2007
    Alberta
    Posts : 4
    Vista Ultimate 32b
    Local Time: 03:28
    canada ca alberta

     

    Re: System Files

    Is Windows Mail the same as Outlook?
    By that I mean would Outlook lose it's settings or just Windows Mail?

      My System SpecsSystem Spec

Page 1 of 18 12311 ... LastLast
System Files - SFC Command

Similar Threads
Tutorial Category
dir command vis-a-vis hidden files
Does DIR normally display hidden files? On my system it does, regardless of the setting in folder options. I have to use the /a-h option to stop...
Vista file management
command for system restore
Is there anyone who is aware of the command for system restore for Windows XP using command prompt. I don't need...
General Discussion
Command Prompt System error 5
My computer at the loggin screen has an admin account witha strong pass and my account. Ive tried command prompt to try and change the admin password...
General Discussion
What is the command line command for unzipping files?
On a stock Vista box we need to be able to extract files from a zip file from a command line batch script. I can't seem to find a command for this....
Vista General
execute command on remote system
i have a script that does a db backup and then copies itself over to another system when it gets to that system i'd like to run a db check on the...
PowerShell
Moving hidden system folders from the Vista command prompt?
Hi everyone. I had some problems with Vista Ultimate and re-installed the OS. It was afterwards that I realized a tv card was the source of all...
Vista General
Wrap command shell in System.Diagnostics.Process
Does anyone know why using System.Diagnostics.Process to "wrap" a console application does not always transmit the I/O, depending on what processes...
PowerShell