Menu

Batch compressing help

2010-07-19
2012-12-08
  • fleshtheworld fleshtheworld

    I want to compress all these files/folders individually in 1 batch process. If i had 1 billion folder OMG!!! See the problem. So i need help batch compressing these folders. I have yet to find out how to.

     
  • fleshtheworld fleshtheworld

    Additional info i forgot to mention - I was able to access the command line but dont know what commands to use or how to use it so that it executes on the desired files/folders.

     
  • Vacon

    Vacon - 2010-07-19

    Hello everyone,

    have a look here and re-arange the command-lines to fit your needs.

    Best regards!

     
  • fleshtheworld fleshtheworld

    My mind is not is the right state of mind to be able to decipher 'for %i in (*.pdf) do 7z -a %i.7z %i ', and to learn the command line version of 7zip.

    Anyone in the right state of mind able to decipher that and use it according to the image showing the directory in the first post? I want to batch compress the folders in there.

    If you do that ill let you keep a picture i just drew - its a WIP and ill send you the completed version when done.

     
  • mpam

    mpam - 2010-07-20

    I think the commands there will suit your needs: http://notepad.patheticcockroach.com/857/some-7-zip-command-line-examples/ They're meant to be launched from command line, but for a batch file just add some extra % where needed, like:
    for /D %%A in (*) do "G:\full\path\to\7z.exe" a -t7z -m9=LZMA2 "%%A.7z" %%A

     
  • mpam

    mpam - 2010-07-20

    hm looks like I can't edit, little mistake in previous post, it should be:
    for /D %%A in (*) do "G:\full\path\to\7z.exe" a -t7z -m9=LZMA2 "%%A.7z" "%%A"

     
  • fleshtheworld fleshtheworld

    @vacon and mpam

    Thank you both!

     
  • fleshtheworld fleshtheworld

    Hi people. I am trying to do the same batch process but this time so that it avoids/removes the folders from being included, and only compress the files (including sub folders within the first sub folders off course) within the folders. So when you open one of the generated archives there is no folder to go through first, just the files right there. But i still want to compress the main folder that consist of all the sub folders, just not the first sub folders them self.

    This is the current code that archives the folders in a batch, im trying to change it so it does the trick above.
    for /D %A in (*) do "H:\Program Files\7-Zip\7z.exe" a -t7z -m9=LZMA2 "%A.zip" "%A"

    Also, i find that compressing in command line makes the archives different from compressing using the GUI, is this so because iv notice that they are different and only the GUI works properly for what im using them for. The command line archives are somehow different. Am i even making the archives into .zip format properly?

     
  • mpam

    mpam - 2010-07-21

    This creates 7z (-t) LZMA2 (-m9) archives. So that's not a proper zip archive if you just change the extension ;) For zip I think you could try sth like -tzip and -m9=Deflate.
    As for what you describe, I don't know (yet)… I'll see what I can find…

     
  • fleshtheworld fleshtheworld

    Thanks, i am slowly (when time allows) learning to see what can be done to achieve what i mentioned. Complex command with command-line is very new to me.

     
  • Vacon

    Vacon - 2010-07-21

    Hello everyone,

    well, take your time and start with simple things. Read the help-file that ships with 7-Zip and try to get some information about command-line and what is the difference between a command given in by hand on a prompt and a batch-file.
    Believe me, it helps :-)

    Best regards!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.