Search code examples
7zip

How do i compress multiple folders into zipped folders without creating subfolders?


I am trying to compress multiple folders (about 100) into individual zipped folders. I did this by making a .bat file like so - for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.zip" "%%X" My problem is that it makes a folder inside the zipped folder, but I need it to just compress the insides of the folder into a zipped folder. I can compress the content of each folder individually but that would take hours. If anybody knows how to do this I would be very grateful :)


Solution

  • for /D %%X in (*) do c:\Program Files\7-Zip\7z.exe"%%X.zip" ".%%X*"

    pause

    just needed to add .\ to to "%%X" (from "%%X" to ".%%d*")