To locate the corrupted files, access the CBS.Log. you will find it at:
C:\Windows\Logs\CBS\CBS.log
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Ok, this is something I've pondered in the past. I have pictures and videos on my NAS for 20 years. Every so often, I start looking around folders and then something sparks a memory and I look for a picture or a video that I remember having and sometimes can't find them. Sometimes I'll find a picture or video that is corrupt.
I have backuips. But, backups are no good if I don't notice it's missing for a year after it's missing and my backups have cycled. I need a way to know when I have missing files or corrupt files. I was thinking for corrupt files, if it could take an inventory of my hard dirve and generate an md5 hash of each file to compare later to let me know if a file has changed.
A while back, I was trying to figure out how to script this. It would be a whole lot nicer if I found a commercial application that was designed for this. Any ideas?
To locate the corrupted files, access the CBS.Log. you will find it at:
C:\Windows\Logs\CBS\CBS.log
this looks promising...
I could write a PS script using this commandlet. Maybe I'll just do my own thing again. I've gotten better at scripting since my last attempt and this is a built in tool in the OS...
This seems to be working... but still would rather a commercial application. I'm going to be messing around with the logic a lot trying to get it right.
$files = Get-ChildItem z:\ -Recurse | where { ! $_.PSIsContainer } | Select -First 50
foreach ($file in $files) {
Write-Host "Filename is " + $file.FullName
Get-FileHash $file.FullName -Algorithm SHA384 | Export-Csv -NoTypeInformation C:\Users\dmorl\Documents\2023-02-24-1957-output.csv -Append
}
Maybe the get-filehash won't work... right now, i have it running on 50 of my files and it's taking forever. I'm sure it's taking forever on video files. I have a ton of video files. I dont have enough processing power to push these through fast enough to be useful.
Got to thinking 384 is excessive. Trying MD5. I know no one is replying. Helps me think though typing it out and maybe it'll help someone else out someday.