Compress Multiple Folders Into Mutiple Zip Files Code

Compress Multiple Folders Into Mutiple Zip Files Code

Use the code below to compress multiple folders into their own seperate individual zip files. Simply follow these steps:

  1. Navigate to folder where to compress the files
  2. Create new text file with notepad and save it (any name you want) with .bat extension
  3. Copy the code on this page depending on what compression format you need
  4. Paste this code into the bat file you created in step 3
  5. Double click on .bat file 

Choose your compression format

for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.zip" "%%X\"
for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.7z" "%%X\"
for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.gzip" "%%X\"
for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.tar" "%%X\"
for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.wim" "%%X\"
for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.b2zip" "%%X\"
for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.xz" "%%X\"
Scroll to Top