0

I'm using 7-zip latest alpha version (9.30) and I find it really inconvenient that, if I want to create a .tar.gz archive, I have to create a .tar archive first then add it to a .gz archive later.

So is there any way (command line or batch script) to make 7-zip create and extract .tar.gz files in Windows in single step only? Or is there other freeware alternative that can achieve this?

Edit: I tried Peazip but this software won't play well with Total Commander as its context menu doesn't show when I right-click on files. Every time I add multiple files for archiving, for example 5 files at once, Peazip will shows exactly 5 of its windows flashing on screen.

phuclv
  • 30,396
  • 15
  • 136
  • 260
Teiv
  • 1,029

2 Answers2

1

tar has been added since Windows 10 build 17063, so you can use it directly. Just create a file named gz.reg with the below content to handle .tar.gz files

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\SystemFileAssociations.gz]

[HKEY_CLASSES_ROOT\SystemFileAssociations.gz\shell]

[HKEY_CLASSES_ROOT\SystemFileAssociations.gz\shell\extract] @="Extract .gz file..."

[HKEY_CLASSES_ROOT\SystemFileAssociations.gz\shell\extract\command] @="C:\Windows\system32\tar.exe xzf "%1""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes*\shell\Compress to .tar.gz\Command] @="C:\Windows\system32\tar.exe czf "%1.tar.gz" "%1""

Then double click on it to add it to the registry. Now just right click on any file and select Compress to .tar.gz or right click on any .tar.gz file and select Extract .gz file...

The last two command registry keys are the real commands to compress/extract. You can add the v option (cvzf, xvzf) to get more verbose information during compression/extraction

Note that this is very primitive and doesn't handle all the extensions like *.tar.xz, *.tgz, *.tar.bzip2... And of course for more control over the output you may need to write a script and call it in the command registry keys above instead of calling tar.exe directly

phuclv
  • 30,396
  • 15
  • 136
  • 260
0

One non-freeware option is Directory Opus. It may not be a good option for you since it's a competing product to Total Commander, but it's a worthy competitor with a tonne of great features that are really nicely implemented. Who knows, it may be worth the price of admission if you like its other features?

It's built in archiving function will add a hand-picked selection of files to a tgz archive in one step.

Trial at http://www.gpsoft.com.au/