The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,977 other subscribers

7zip / 7za command-line parameters for highest compression

Posted by jpluimers on 2019/03/14

On my systems these so far give the best compression results with 7zip and p7zip 16.02:

-t7z -m0=lzma2:d=1024m -mx=9 -aoa -mfb=64 -md=32m -ms=on

Note the -d=1024m is mentioned on some sites, but is gone around version 16.


If you want to delete the files after archiving, then use the -sdel switch: -sdel (Delete files after including to archive) switch

If -sdel switch is specified, 7-Zip deletes files after including to archive. So it works like moving files to archive., moves txt files from disk’s directory to a.7z archive.


One Response to “7zip / 7za command-line parameters for highest compression”

  1. Peter Wright said

    Just a small warning about what is otherwise an excellent product. I refer to an unfixed bug where an archive contains an 8.3 filename and a long filename. If the long filename is extracted first, default OS behaviour is to generate a short filename along with the long filename. If the short filename generated by the OS matches the 8.3 filename recorded in the archive (remembering that it’s a different file entirely) then 7zip will prompt for some user-interaction (overwrite,skip, generate new file name, etc.)

    This issue was raised nearly 4 years ago, is very easy to fix (simple extract the 8.3s first, then the long filenames) but the response is very negative and unprofessional (“I think this matter should be handled by the OS” and “The fact is that filenames like demons~1.txt do not usually appear in archives. In my opinion, this behavior with short names needs not to be fixed, at least in 7-Zip”.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: