# How can I test all zip files in a folder to verify if they are corrupted or not?

There was a utility a long time ago called CFAtest that was doing this quite nicely, but it has disappeared.

Basically, I am looking for a similar tool (preferably graphical) that will traverse a given path (preferably including subfolders) and test all zip files that it finds.

Decent logging options would be a plus.

-
Which operating system? –  Matteo Dec 31 '12 at 10:23

This will find in all subfolders the files (-type f) with the extension zip (or ZIP or Zip or zIp and so on, case is ignored, -iname) and test their integrity (unzip -t).

find -type f -iname '*.zip' -exec unzip -t {} \;

-
And if you are on Windows and don't have find, install Cygwin. –  Daniel R Hicks Jan 23 '13 at 12:23
... or use the for command. –  Karan Jul 15 '13 at 6:17
... or download gnuwin32.sourceforge.net –  Franck Dernoncourt Mar 8 '14 at 18:36

On Windows I use 7zip: it provides a graphical user interface, is free and supports a wide range of archive file formats including zip.

Navigate to the given folder you want to analyze on Windows Explorer. Search for *.zip, select all files, right-click, select "Test Archive"

Then wait (note that it takes around 10 minutes for explorer.exe to go through 100,000 .zip before 7z start testing):

-

It might not be quite what you asked for but there is a tool named Zip2Fix.

http://leelusoft.blogspot.com/2011/06/zip2fix-10.html

-

### Quick PowerShell command - using 7zip's commandline "t" switch

$7z = "T:\folder\to\7z.exe" Dir "C:\folder\to\check" -r -include @("*.zip","*.7z") | % { &$7z t \$_ -r}


### Output

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Processing archive: D:\testfile.zip

Testing     my test file.txt
Testing     second file.doc

Everything is Ok

Folders: 0
Files: 2
Size:       10353
Compressed: 5721

-

erik's answer didn't work for me on a Mac but this works for zips in current folder and all subfolders:

find . -name '*.zip' -exec unzip -tq {} \;


Outputs this for each file:

No errors detected in compressed data of ./2013-10-16.zip.

-