SFC IS YOUR FRIEND

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
User avatar
richardj
Posts: 1382
Joined: Fri Sep 10, 2004 11:02 pm

SFC IS YOUR FRIEND

Post by richardj »

System File Checker (sfc.exe)

You will often see references to scannow sfc in online newsgroups etc. This is a great tool for troubleshooting Windows XP problems.



How to use scannow 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.

Image




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:

Image


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

Step 1

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



-----------------------------

Step 2

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_MACHINESOFTWAREMicrosoftWindows\nCurrentVersionSetup

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:\n
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!


ALso- you can do this from a command line

Start-run cmd-ok then type SFC in the black box & you get:

Microsoft Windows XP [Version 5.1.2600]
© Copyright 1985-2001 Microsoft Corp.

C:Documents and SettingsRICHARD>sfc

Microsoft® Windows XP Windows File Checker Version 5.1
© 1999-2000 Microsoft Corp. All rights reserved

Scans all protected system files and replaces incorrect versions with correct Microsoft versions.

SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/REVERT] [/PURGECACHE] [/CACHESIZE=x]


/SCANNOW Scans all protected system files immediately.
/SCANONCE Scans all protected system files once at the next boot.
/SCANBOOT Scans all protected system files at every boot.
/REVERT Return scan to default setting.
/PURGECACHE Purges the file cache.
/CACHESIZE=x Sets the file cache size.

C:Documents and SettingsRICHARD>
:blink:

What I will do is type in SFC /purgecache this deletes the existing files it uses as a backup to Windows files.

Then I type in SFC /Cachesize=200MB This tells it to save 200 MB for it's files.
(I can afford the disk space)

NOW REBOOT-this is important

Then run SFC /scannow with your cd in place or as the above describes & SFC will rebuild it's base files while repairing any protected files. It kindof makes it look twice.

All this is FREE :banana:

Archived topic from Iceteks, old topic ID:3779, old post ID:30688
User avatar
jryan
Posts: 395
Joined: Wed Dec 18, 2002 1:19 am

SFC IS YOUR FRIEND

Post by jryan »

Richard,

Have you thought about writing actual articles for the IceTeks community? I think this post here, converted into an article, would possibly bode well for us from a traffic-generation standpoint. Your article is full of useful info, just wondering if maybe you had thought about approaching Red to have this featured directly on our Article section..

Archived topic from Iceteks, old topic ID:3779, old post ID:30700
User avatar
richardj
Posts: 1382
Joined: Fri Sep 10, 2004 11:02 pm

SFC IS YOUR FRIEND

Post by richardj »

LOL :P

Well that's a nice thought

However-except for title & the last part of the above---


The rest is plagiarized :blush:

Image


Archived topic from Iceteks, old topic ID:3779, old post ID:30703
User avatar
jryan
Posts: 395
Joined: Wed Dec 18, 2002 1:19 am

SFC IS YOUR FRIEND

Post by jryan »

Lol. Well, if you get around to writing some of your own tech articles, let us know. I'm sure we'd post them under the articles section (*heck, I wrote an Outlook Express one about two years ago that I have to update soon lol)

Archived topic from Iceteks, old topic ID:3779, old post ID:30707
Locked