7ZIP - Command Line Compression | Can Never Keep it Simple

Posted by OneTwoYou on Super User See other posts from Super User or by OneTwoYou
Published on 2011-11-03T21:32:08Z Indexed on 2013/11/05 21:58 UTC
Read the original article Hit count: 220

Filed under:
|

I've been Googleing for a few hours on how to just compress a file inside a directory and I can't find anything. I found how to just compress a folder in general. Now I wish to know how I can compress a folder in a folder with a file. Current code:

7zG.exe a -tzip "test.zip" dontcompressme/compressme/new.txt
pause

As you can see above, I don't want to compress the first folder, but only the second and what ever is within that folder. I have the 7zG.exe sitting in the main folder and I have some files that are three folders in, but I don't know how to only compress those. Here is my directory list:

  • Folder One (don't compress)
    • Folder Two (don't compress)
      • Folder Three (okay to compress)
        • Document One.txt (okay to compress)
        • Document Two.txt (okay to compress)
        • Index.html (okay to compress)

Does anyone know how I can do this in the most simplest way ever invented by man? Cause whenever I go to a website using Google it goes throw all these methods on how to compress a folder, but not do it the way I wish it to do. It makes me kinda upset cause I can't get a simple and straight forward answer. Thank you if you answer my question.

© Super User or respective owner

Related posts about Windows

Related posts about 7-zip