Geeks in Phoenix

Geek Blog


Check Windows 10 system files with System File Checker

I was thinking the other day about what program I use the most in doing computer repair. The one program I use the most on Windows based computers would have to be System File Checker (SFC). SFC checks for system files that may have gotten corrupt or replaced with incorrect versions. Here's how to check Windows 10 system files with System File Checker.

Check Windows 10 system files with System File Checker

SFC has been included in every version of Windows since Windows XP. In fact, you can also build it into the Microsoft Diagnostics and Recovery Toolset (DaRT). There is no shortcut or link to SFC in Windows 10, as it runs inside of an Administrative Command Prompt.

How to open a Command Prompt with Administrator privileges in Windows 10

SFC running inside of Windows 10 Administrative Command Prompt

The following is the syntax and switches for SFC. The most commonly used syntax / switch is: sfc /scannow.

SFC [/SCANNOW] [/VERIFYONLY] [/SCANFILE=<file>] [/VERIFYFILE=<file>] [/OFFWINDIR=<offline windows directory> /OFFBOOTDIR=<offline boot directory>]

/SCANNOW (Scans integrity of all protected system files and repairs files with problems when possible.)
/VERIFYONLY (Scans integrity of all protected system files. No repair operation is performed.)
/SCANFILE (Scans integrity of the referenced file, repairs file if problems are identified. Specify full path <file>.)
/VERIFYFILE (Verifies the integrity of the file with full path <file>. No repair operation is performed.)
/OFFBOOTDIR (For offline repair specify the location of the offline boot directory.)
/OFFWINDIR (For offline repair specify the location of the offline windows directory.)

Examples

sfc /scannow sfc /verifyfile=c:\windows\filetobereplaced.dll sfc /scanfile=d:\windows\filetobereplaced.dll /offbootdir=d:\ /offwindir=d:\windows sfc /verifyonly

Once SFC is done scanning the system files, it will give one of four possible results:

  • Windows Resource Protection did not find any integrity violations.
    All system file are fine and you're good to go.
  • Windows Resource Protection could not perform the requested operation.
    There may be another program preventing SFC from running. In this case boot the system up into safe mode and run SFC from there.
  • Windows Resource Protection found corrupt files and successfully repaired them.
    All system files are now correct and you're ready to go. If you want to view the repair details, see below.
  • Windows Resource Protection found corrupt files but was unable to fix some of them.
    If you get this message, SFC found a file or files that it wasn't able to repair. The next thing you will need to do is find out what the name of the file(s) are. Using the Find String utility, you can filter out the SFC results with only the components that were scanned and create a text file with that information on your Desktop called sfcdetails.txt. Just copy the following code into an Administrative Command Prompt:
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt"

Manually replacing a corrupt system file in Windows 10

Note: To replace a corrupt system file, you will need to have a known good copy of the file(s) in question. A good source for files is another computer or virtual machine running Windows 10. Since I do computer repair for a living, I have all of the versions of Windows that are still supported by Microsoft running inside of Oracle VirtualBoxes.

First thing to do is make note of the location (path) and name of the file(s) that need to be replaced from the sfcdetails.txt file. Once you have another copy of the corrupt file(s), you will need take administrative ownership of the file(s). To do this, modify the following command with the path\filename of the file you want to replace and then type it into an Administrative Command Prompt:

takeown /f path\filename

Example: takeown /f C:\Windows\FileToBeReplaced.dll

Next you will have to grant administrators full access to file(s) being replaced. To do this, modify the following command with the path\filename of the file you want to replace and then type it into an Administrative Command Prompt:

icacls path\filename /grant administrators:F

Example: icacls C:\Windows\FileToBeReplaced.dll /grant administrators:F

Third thing to do is copy over the new file(s) and replace the corrupt one(s).To do this, modify the following command with the path\filename of the file you want to replace and then type it into an Administrative Command Prompt:

copy path\filename path\filename

Example: copy C:\Temp\FileToBeReplaced.dll C:\Windows\FileToBeReplaced.dll

Add comment

Customer service is #1

Here at Geeks in Phoenix, we take pride in providing excellent customer service. From computer repair, virus removal and data recovery, we aim to give the highest quality of service.

Bring your computer to us and save

Our in-shop computer repair service  is based on the time we work on your computer, not the time it takes your computer to work!

Contact us

Geeks in Phoenix
4722 East Monte Vista Road
Phoenix, Arizona 85008
(602) 795-1111

Like Geeks in Phoenix on Facebook

Follow Geeks in Phoenix on Twitter

Watch Geeks in Phoenix on YouTube

Geeks in Phoenix is an IT consulting company specializing in all aspects of Computer Repair / PC Repair / Laptop Repair. Since 2008, our expert computer repair technicians have been providing outstanding Computer Repair, Virus Removal, Data Recovery, Photo Manipulation and Website Support.

Geeks in Phoenix have the best computer repair technicians providing computer repair and service in Phoenix, Scottsdale and Tempe Arizona. We offer In-Shop, On-Site and Remote (with stable Internet connection) computer repair service.

Copyright © 2016 Geeks in Phoenix LLC