Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to Manually Do SFC's Job?


14 May 2012   #1

Windows 7 Home Premium x64
 
 
How to Manually Do SFC's Job?

I do a lot of work on customer machines at a computer shop, and one of the most frustrating issues I run into is when I run SFC on a computer and it reports that it found errors and was unable to fix them.

Originally I intended to write a program to automatically pull the [SR] reported files from the installation media and replace the broken ones on the system, however, when I run the command from the tutorial:

findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log

After an unsuccessful SFC attempt, even when it reports files that could not be fixed, I never turn up anything, anyone know why I don't get the [SR] tags in my CBS.log?

My System SpecsSystem Spec
.

14 May 2012   #2
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

Hello Virucyde, and welcome to Seven Forums.

You could use OPTION THREE in the tutorial below to get a sfcdetails.txt file with the [SR] details. If you like, upload this file here afterwards, and I'll be happy to take a look at it to see what could not be fixed.

SFC /SCANNOW Command - System File Checker
My System SpecsSystem Spec
14 May 2012   #3

Windows 7 Home Premium x64
 
 

I've tried using both the command I posted and the exact one in the tutorial, if [SR] tags were in the files, mine should output the lines to the command prompt, and the tutorial's should output them to the text file, in both cases, on multiple computers, the commands return nothing, and a search of the CBS.log file shows no [SR] tags.

One piece of information that might be helpful is that I think most of the times I've attempted this, it's been using the /offwindir and /offbootdir commands from a PE, is the CBS.log file only generated if SFC is run in the OS being scanned?
My System SpecsSystem Spec
.


14 May 2012   #4
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

Yeah, try running SFC in Windows 7 to see what it gives you afterwards.
My System SpecsSystem Spec
14 May 2012   #5

Windows 7 Home Premium x64
 
 

What about cases where the computer is unable to boot at all? This tends to be when I'm using SFC in the first place :/
My System SpecsSystem Spec
14 May 2012   #6
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

The link below seems to have worked for when having to do it at boot with PE.

SFC runs, finds errors, but does not create CBS.log file
My System SpecsSystem Spec
14 May 2012   #7

Windows 7 Home Premium x64
 
 

Okay, so to summarize what I got out of that, in my PE environment in order to get SFC logs, I'd need to:

Assuming the offline Windows drive is drive F:

Set the variable for the log file, so SFC doesn't attempt to store to log to the read-only media:
set WINDOWS_TRACING_LOGFILE=F:\TEMP\CBS.log

Run SFC with offline parameters:
sfc /scannow /offbootdir=F: /offwindir=F:\Windows

Once that command has finished, it's output should be logged to F:\TEMP\CBS.log, or wherever else you specified.
So to pull the errors out of the file, run:
findstr /c:"[SR]" F:\TEMP\CBS.log

This will output all error lines to the command prompt, if you want that output to go to a file instead, run:
findstr /c:"[SR]" F:\TEMP\CBS.log > F:\TEMP\sfcdetails.txt

Now your details regarding the failed repairs should be contained in F:\TEMP\sfcdetails.txt

Hopefully anyone Googling how to use SFC from WinPE in the future will find this helpful!

Also, thanks Brink, I appreciate the help, very fast, very effective
My System SpecsSystem Spec
14 May 2012   #8
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

Correct. That's what I got from that post as well. I prefer the sfcdetails.txt to make it easier to read though.

Please let us know how it works for you.
My System SpecsSystem Spec
14 May 2012   #9

Windows 7 Home Premium x64
 
 

Also, according to Window's documentation on SFC:

Quote:
On Windows Vista only, you can set the WINDOWS_TRACING_LOGFILE environment variable to the location of a valid directory to receive a log file.
Unfortunately I can't test it now, but I'd guess that in my above example, F:\TEMP would already need to exist, so the command:
mkdir F:\TEMP

Might be necessary before running the other commands, just an afterthought, I'll edit that post when I get another chance to test it out.
My System SpecsSystem Spec
Reply

 How to Manually Do SFC's Job?




Thread Tools



Similar help and support threads for2: How to Manually Do SFC's Job?
Thread Forum
Solved Should I defrag manually or not Performance & Maintenance
Solved Should I manually set RAM timings? Hardware & Devices
Manually Update? Windows Updates & Activation
manually adding a ocx file ? Browsers & Mail
Manually defragment possible? Software
manually scandisk Performance & Maintenance
Can't manually rearrange Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 02:59 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33