Q&A for How to Use 7Zip to Create Multiple Compressed Folders in One Go

Return to Full Article

Search
Add New Question
  • Question
    How can I zip only certain file types (e.g. PDF) across multiple folders/sub-folders?
    Community Answer
    Create a bat file with the following command (replace pdf with desired extension): FOR %%i IN (*.pdf*) DO "c:\Program Files\7-Zip\7z.exe" a "%%~ni.zip" "%%i".
  • Question
    What if the folder names have spaces?
    Community Answer
    Spaces in the folder names did not cause any issues for me. Test it out on a few practice folders and you should be able to tell if there are any issues.
  • Question
    Can a bunch of files be password-protected using a batch file?
    Community Answer
    Yes; after the command, add the -p switch and then the password with no spaces between (i.e. "-ppassword"). Add -mhe on the end of that to encrypt the headers, which that means that whoever opens the zipped archive will have to provide a password to view its contents.
  • Question
    Is there any way to change the compression level to ultra using this method?
    Community Answer
    Edit the .bat file and put which ever one of these that you want at the end. -m0=LZMA2 sets the compression method to lzma2 . -mx=9 sets the compression level to ultra. -mfb=64 sets the word size to 64. -md=32m sets the dictionary size to 32 megabytes. -ms=on sets it to solid.
Ask a Question

      Return to Full Article