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. Downoad 7-zip from this link:https://www.7-zip.org/
  2. Navigate to folder where to compress the files
  3. Create new text file with notepad and save it (any name you want) with .bat extension
  4. Copy the code on this page depending on what compression format you need
  5. Paste this code (as plain text) into the bat file you created in step 3
  6. 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