0

In Windows, is there a tool or way to easily find all files (maybe within a directory tree only) to list all files whose file size is a whole multiple of 64KB?

I.e. those files that may have been truncated by a chkdsk or rounded up at one point; either way, possibly corrupt.

I liked using the fast Everything software because it takes advantage of the filesystem's built-in journal and file index of sorts, allowing me to disable the resource-intensive Windows Search service. It doesn't have this option, aside from specifying a single exact filesize like other search software, though maybe the CLI can be useful.

2

You can use powershell for that:

Get-ChildItem -Recurse | ForEach-Object { if (!($_.Length % 64kb)) { Write-Host $_.FullName } }

The get-childitem cmdlet iterates over a folder (and optionally its subfolders). Pipe the results into a ForEach-Object and check for the Length of the file. If it meets our criteria write the FullName to the host.

1
  • Thanks. Added { Write-Host $_.LastWriteTime, $_.Length, $_.FullName } to get a better idea of what's happening (often, similar timestamps help link effects to a single event...to group a whole class of files as "damaged/suspect"). – Marcos Aug 10 '15 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.