ntfs: finding all files sized at 64k intervals

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.

Marcos

Posted 2015-08-10T08:43:23.790

Reputation: 1 051

Answers

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.

rene

Posted 2015-08-10T08:43:23.790

Reputation: 1 115

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 – 2015-08-10T10:45:52.513