New
#130
Hi,
Yep VerifyOnly
RestoreHealth
scannow
Should fix the issue after restart
VerifyOnly again.
Does the CBS Log file that SFC scannow creates get automatically recreated if you delete it? It would be handy to be able to clean the log out after each repair has been done. I don't know if that's recommended though or even possible? Do you delete or clean the log file somehow after you've read it or completed all repairs or just leave it alone to keep being added to when new SFC scans are run?
Thank you.
Fix or wait? That's also a crapshoot.
MS is notorious for draggin' their heels and the longer you wait the higher the percentage goes with having major problems on the 'next' update so, IMHO I believe it would be best to correct the error as soon as possible.
Does the log file get recreated?
If you mean the CBSpersist.log yes, the CBS.log is always present. Once the CBS.log reaches 35 to 40MB the system creates the CBSpersist.log and moves that 35 to 40MB to it.
Then the CBSpersist.log cools its heels until the CBS.log reaches 35 to 40MB again. Then the CBS.log dumps that fresh 35 to 40MB to the CBSpersist.log and it (the CBS.log) starts anew.
Maybe a poor metaphor but think of CBS.log as wash and repeat with CBSpersist.log as rinse and the whole task as wash, rinse, repeat.
Keeping a smaller persist.log would be easier to read and I'm not sure if the CBS log gets recreated if it's deleted I think it does but I've never tried it, and I leave my persist log alone.
You can use findstr commands to extract just the entries in the cbs log that you want.
- You never need to look through the entire log.
- SFC entries contain [SR]
- Other Windows functions, such as Windows installer, also write to the CBS log.
To extract all SFC entries into a text file {choose your own path & filename; I include the computer name because I run the same code on several computers}
Code:findstr.exe /c:"[SR]" %windir%\Logs\CBS\CBS.log >D:\Desktop\%ComputerName%-SFCResults.Log
To extract all SFC repairs into a text file {choose your own path & filename}
Code:findstr.exe /c:"[SR] Repair" %windir%\Logs\CBS\CBS.log >D:\Desktop\%ComputerName%-SFCResults-Repairs.Log
To extract all SFC failures to repair into a text file {choose your own path & filename}
Code:findstr.exe /c:"[SR] Cannot repair member file" %windir%\Logs\CBS\CBS.log >D:\Desktop\%ComputerName%-SFCResults-Unrepairables.Log"
Note that every line in the output files has its date-time stamp so if the extracts were very long you could just search for the first instance of today's date to start looking through what it has just been up to.
Do also note that Windows sends the cbs.log into archive every so often and starts a new one. The CBSPersist*.Log files are the retained archives [and they might eventually be deleted as well.] {Added later - Anak refers to this above}
Denis
Thanks very much for your detailed explanation. So deleting the CBS log file after each SFC scan or editing out all older and fixed sfc details doesn't sound like its recommended or maybe not even possible. I just thought it might be easier if it just included the current SFC scan. I thought that the CBS log file was just for viewing the the results of sfc scans but from what you have just said other Windows functions, such as Windows installer, also write to the CBS log. I didn't know that.
This is not a question that I have ever considered and I don't see any advantage from deleting it even if it is possible to do so without repercussions.So deleting the CBS log file after each SFC scan or editing out all older and fixed sfc details doesn't sound like its recommended or maybe not even possible.
By extracting what you want on any particular occasion, you can focus on the entries of interest quite quickly.
Denis