Tag Archives: batch zip unzip

How to unzip a group of zip files?

The following one-line batch script will unzip all zip files in current directory to separate directories. Assuming you have an unzip tool in your path…

It checks each zip file in current directory and if there is no directory with same name as the file name without extension – it creates the directory and unzips the file into the directory.

for %a in (*.zip) DO (if not exist %~na (md %~na & cd %~na & unzip ..\%a & cd ..))

This one will also delete the zip files:

for %a in (*.zip) DO (if not exist %~na (md %~na & cd %~na & unzip ..\%a & cd .. & del /q %a))