How do I add files from a directory to a .zip-File using the 7zip command line?

8,510

I assume you want to use the zip format instead of the 7z format so set -tzip and include the path in quotes in case there is a space in the path.

7z.exe a -tzip "file.zip" "C:\folder"

Check the cmd manual for more details: http://sevenzip.sourceforge.jp/chm/cmdline/commands/index.htm

Share:
8,510

Related videos on Youtube

DigitalClark
Author by

DigitalClark

Updated on September 18, 2022

Comments

  • DigitalClark
    DigitalClark over 1 year

    I am using the 7zip command line to zip-up files. How can I add all files and subdirectorys from a folder to a zip file (.jar archive file)? I used:

    7zip.exe a -t7z file.zip C:\folder
    

    Thank you.

  • DigitalClark
    DigitalClark over 11 years
    Thank you. I know that page, I have it open in another tab. Can I have an example maybe :-/?
  • user978122
    user978122 over 11 years
    7z.exe u -t7z file.zip C:folder* -r?
  • DigitalClark
    DigitalClark over 11 years
    Yay, that should work, but I can't test it because .jar-Files are not compatible... Thanks anyway.