Friday, May 18, 2007

How to use SFC

The main reason for using this utility is when you suspect there may be a problem with a Windows XP system file.

Perhaps you get a dialog box appear informing you of a problem with a .dll file, or your program will just not load! It is therefore worth checking to see if there are any corrupt system files using scannow sfc.

To do this simply go to the Run box on the Start Menu and type in: sfc /scannow This command will immediately initiate the Windows File Protection service to scan all protected files and verify their integrity, replacing any files with which it finds a problem. The following should appear to give an indication of how long the process is taking.


In an ideal world that would be the end of the story...

Any corrupt, missing or incorrect files would be replaced by this process. However, things can go wrong and the following guide should help!

The #1 complaint with scannow sfc is the following dialog box appearing:


Why does this happen?
Well, in your computer's registry, are several settings that are checked when you run scannow sfc. As mentioned earlier in this article, the Windows File Protection service constantly monitors for any changes to the main system files.

Well Windows XP keeps a cache (copy) of these essential files at the following location: C:WINDOWS\System32\Dllcache (assuming C: is your system root which it probably is.) NB - The dllcache folder is extremely important so Windows XP hides it from you!

To view it go to:
My Computer > Tools > Folder Options > View > "uncheck" Hide protected operating system files. If that's the case on your computer then there is normally no need for the original XP CD to be inserted as your computer has a "copy" it can get hold of in this cache...

But, if the Dllcache folder, or part of it, has become corrupted for some reason then you will be prompted for the XP CD - so your computer can get a clean copy! Having said that not ALL installations of Windows XP have ALL the system files cached into this folder! You may only have around 50MB of files in this folder under Windows XP depending on the quota settings in the registry. (Under Windows 2003 Server the default is 300MB of system files!)

Annoying, YES!
Is there a workaround
YES!

As well as having a cache of all the system files on your PC, I like to have the I386 folder from the XP CD installed on the computer as well. After doing this I then modify the registry to tell it the source path for these files... Why? Well not only does this prevent 99% of request for the the XP CD with Windows File Protection.

But the I386 folder also contains many other files that are sometimes needed by the operating system and this stops those requests for the XP CD too! NB - With today's large hard drives you are not going to notice this 475 MB folder on your computer, but older systems may not have the space for this...

You will need to get your XP CD and locate the folder called: I386 This is a major folder and should be one of the first you see, now copy this onto your hard drive into the system root. For most of you that is going to be C:\ so you should end up with a folder that looks like: C:\I386

Now you will need to tell your computer you now have the files on your PC.
We do this is the registry (type regedit in the Run box on the start menu) by navigating to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\
CurrentVersion\Setup You will see various entries here on the right hand side.

The one we want is called: SourcePath It probably has an entry pointing to your CD-ROM drive, and that is why it is asking for the XP CD.
All we need to do is change it to: C:\ Simply double click the SourcePatch setting and a new box will pop up allowing you to make the change.

Now restart your computer and try scannow sfc again!