Windows 8 How to use SFC /SCANNOW command in Windows 8

zigzag3143

Contributor, Sysnative Staff Emeritus
Joined
Mar 27, 2012
Posts
3,741
Re: Windows 8 How to use SFC /SCANNOW command in Windows 8Windows 8

Instead of specifying C:\ directly, I think it would be better especially if you had that command in a batch file to be using:
Code:
findstr /C:”[SR] Cannot repair member file” %windir%\logs\cbs\cbs.log > %windir:~0,1%:\sfcreport.txt

Instead of:
Code:
findstr /C:”[SR] Cannot repair member file” %windir%\logs\cbs\cbs.log > C:\sfcreport.txt

But other than that, if you're typing it out, you may not want to remember (if you don't know batch), or write all of that out. It would be my preference, although if you know C:\ is there and you can write to that drive letter location, it should be fine. The odd setup though depending, you may have things different.

I've got to get stuff up on my new website and blogs.... lol

edit: You can also use:
Code:
%SystemDrive%\sfcreport.txt
 
Last edited:
Re: Windows 8 How to use SFC /SCANNOW command in Windows 8Windows 8

I personally prefer to read through the CBS log file and find the [SR] lines myself by eye or with the find command. There is a lot more useful information there without parsing it out automatically via a script or a string finding method.

niemiro is the best I've seen at getting information from the CBS log file after a system file check, and he was the one who taught me how useful it is to get all the information provided through that log instead of parsing out the [SR] lines.
 
Re: Windows 8 How to use SFC /SCANNOW command in Windows 8Windows 8

I personally prefer to read through the CBS log file and find the [SR] lines myself by eye or with the find command. There is a lot more useful information there without parsing it out automatically via a script or a string finding method.

niemiro is the best I've seen at getting information from the CBS log file after a system file check, and he was the one who taught me how useful it is to get all the information provided through that log instead of parsing out the [SR] lines.

You don't need to parse out the [SR] lines only though, and that's the beauty of having a script to do it for you. If you know lines that may be valuable, it's still fairly easy to retrieve all of the unaccounted lines by modifying what to look for automatically. :)

Provide me with a variety of lines, and i'll come up with a script that can retrieve them all so I can show you what I mean if you want? Remember, findstr supports Regex.

~Ace
 
Re: Windows 8 How to use SFC /SCANNOW command in Windows 8Windows 8

I probably should publish a tutorial on this. I have a draft, it just needs proof reading and tweaking. Just need to find the time!

There is a balance between including too much, and making the log unreadable for the normal person, and not including enough.

Personally, I like taking the entire log so that I know that I have everything, rather than being slightly in doubt as to whether I have everything. In addition, I screen all CBS.logs I get (even just SFC ones) for non-SFC Windows Update problems.

I revise this every so often, but here is my current favourite SFC only log:

Code:
findstr /C:"[SR]" /c:"Hashes for file member" /c:"Manifest hash for component" /c:"Unable to load manifest for component" /c:"Expected:" /c:"Found:" /c:"Store corruption detected in function" /c:"FileHashMismatch on resource"/c:"WARNING: Deleting invalid luacdf" /c:"Repair results created:" /c:"Looking for manifest in Backup Dir..." %windir%\logs\cbs\cbs.log > %userprofile%\Desktop\sfcreport.txt

and with "Error " as well (notice the space at the end, this was intentional). This shows non-SFC related errors also. I personally prefer it, as I might just pick something else up. However, care needs to be taken, as not all errors need to be fixed. It just requires looking over and assessing. It also has the advantage of picking up all errors during the SFC run. These are rare, but do happen. Sometimes they prematurely end SFC, othertimes a certain file cannot be scanned. Don't miss the fact that it might be corrupt. It couldn't be scanned, it didn't come back clean. I have included the most common error in the first report ("Unable to load manifest for component"), but there are others. If you detect one, with the exception of "Unable to load manifest for component", a whole CBS.log may need to be taken.

Code:
findstr /C:"[SR]" /c:"Hashes for file member" /c:"Manifest hash for component" /c:"Unable to load manifest for component" /c:"Expected:" /c:"Found:" /c:"Store corruption detected in function" /c:"FileHashMismatch on resource"/c:"WARNING: Deleting invalid luacdf" /c:"Repair results created:" /c:"Looking for manifest in Backup Dir..." /c:"Error " %windir%\logs\cbs\cbs.log > %userprofile%\Desktop\sfcreport.txt

Oh, and I dislike the Microsoft KB article on SFC logs. It is extremely incomplete, and in fact is so incomplete that it is next to useless in analysing a log with an actual error in it :eek:

My CBS tutorial also explains how I analyse a log sometimes with >100,000 lines in <1 minute. More details to be released soon.

Richard
 
Don't forget that findstr has Regex capabilities :)

The only downside is that it has a compact version of the full Regex functionality... :r1: "Pseudo-Regex"

edit: This could be a great app for practice development... :)
 
Last edited:

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top