I have a large Windows 7 folder tree structure containing many ZIP files. These are single-layer ZIP files (not ZIP within ZIP). What 7-Zip command can I use to parse through this folder structure, find each the ZIP file by file extension (see example), extract it (deleting the ZIP file, leaving the extracted files) to the same location?
Example: All of the files in the hierarchy of folders are named something like: abc.mp3.zip or xyz.jpg.zip – the native file extension followed by ".zip". I want 7-Zip to find all files in the tree by file extension using wildcards (*.mp3.zip, *.jpg.zip, etc) and extract these to the current location without creating new folders so that the result is abc.mp3 and xyz.jpg.
Best Answer
As far as I can tell, 7-zip doesn't have a command that does what you're looking for. Here's a Windows batch file script which I think will do what you want. It should be run from the command line so you can supply a path to the root of the folder tree to be processed.
File
unzipper.bat
Since as a whole what the script does is fairly radical and potentially destructive because it might extract large numbers of file and delete many zip files afterward, I've disabled the commands on lines 12 and 14 which would do those things by prefixing them with
echo
. This make them just print out what they would have done if theecho
wasn't there. That way you can test the script first without doing any damage to your file system should there be some sort of unexpected problem.To modify the script actually perform these actions, you'll need to remove the
echo
on each of the two lines. Standard disclaimer of any liability applies, of course.