Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

By specifying the filenames in the appropriate place.

Here's a link explaining the command line arguments for 7-zip: http://www.dotnetperls.com/7-zip-examples

share|improve this answer
    
Thank you. I know that page, I have it open in another tab. Can I have an example maybe :-/? –  DigitalClark Oct 13 '12 at 9:02
    
7z.exe u -t7z file.zip C:folder* -r? –  user978122 Oct 13 '12 at 9:06
    
Yay, that should work, but I can't test it because .jar-Files are not compatible... Thanks anyway. –  DigitalClark Oct 13 '12 at 9:48

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|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.