# batch identify files filled with zeros

I have some folders which contain files (old temp P2P files saved wrongly apparently) which are just filled with zeros - any program/batch that can verify this ? I do not want to open each one with a hex editor

-
What kind of files ? –  Sathya Jan 2 '11 at 4:29
023.part - bunch of zeros - there are too many to check all of them individually –  Mr_and_Mrs_D Jan 2 '11 at 13:22
About what size are the files? –  lewist Jan 4 '11 at 9:17
Anything from a few megs to a few gigs –  Mr_and_Mrs_D Jan 4 '11 at 14:33
(Oops, continued from above.) For example, using the standard CRC-16 algorithm, a file containing the hex byte 01 will have a little-endian CRC of C0C1; appending the hex bytes C1 C0 to the file will cause it to have a CRC of zero. –  lewist Jan 8 '11 at 21:49

Adapt the following command (the $jacksum_root_directory variable should have no trailing slash), then open PowerShell and run it to get a listing of files with a checksum of zero: $jacksum_root_directory = 'drive:\path\to\directory'
$jacksum_jar_location = 'drive:\path\to\jacksum.jar' java -jar$jacksum_jar_location -E dec -F "#CHECKSUM #FILENAME" -a crc64 -p -r -f $jacksum_root_directory | where {$_.StartsWith('0 ') } | foreach { get-item \$_.Remove(0, 2) }
When you feel confident that the files listed can be safely deleted, they can be deleted automatically by replacing get-item with remove-item in the third line and re-running the command.