Rezip

User avatar
ErikJan
BronzeLounger
Posts: 1337
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Rezip

Post by ErikJan »

I can't find tools that re-zip / re-compress (other than some fancy super command line reprocessors and someone who made a batch file).

I use 7zip and normally apply Ultra compression (still fast enough with excellent compression). I have a lot of old ZIP files. I did a quick test and on a 267 Mb ZIP file, if I compress the ZIP itself to 7z format, I get to 201Mb. If I extract the files and then recompress I reach 134Mb...

So, looking for a GUI type (and/or Explorer shell integrated) app that allows me to re-compress ZIP files found in folders and sub-folder to 7ZIP's 7z format (reporting password protected files and leaving them alone is fine, I can do these few manually). It would be brilliant if the modified date wouldn't change (but I have ways to 'fix' that).

User avatar
stuck
Panoramic Lounger
Posts: 8543
Joined: 25 Jan 2010, 09:09
Location: retirement

Re: Rezip

Post by stuck »

Isn't this sort of thing that AutoIt can do?
http://www.autoitscript.com/site/autoit/
:whisper: he says confidently as if he knows what he's talking about when he's never actually used AutoIt himself :grin:

Ken

User avatar
ErikJan
BronzeLounger
Posts: 1337
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Rezip

Post by ErikJan »

Could work but I'd have to learn AutoIt and then develop the script to do that... I was hoping something would be out there already...

User avatar
ErikJan
BronzeLounger
Posts: 1337
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Rezip

Post by ErikJan »

This remains something I'd be looking for, even almost 11 years later ;-)

JoeP
SilverLounger
Posts: 2155
Joined: 25 Jan 2010, 02:12

Re: Rezip

Post by JoeP »

You could use a PowerShell script to unzip the files to a location and then invoke 7-Zip to recompress them to a location of your choice. PowerShell is capable of prompting for input(s) such as the file name/location and separately the password. There are many examples if you do a search. There is extensive documentation with sample scripts at Introduction to PowerShell.
Joe

User avatar
stuck
Panoramic Lounger
Posts: 8543
Joined: 25 Jan 2010, 09:09
Location: retirement

Re: Rezip

Post by stuck »

Surely the price of storage these days (I recently bought a 10 TB HDD for not a lot) makes the effort of re-zipping stuff to save only a few MBs a bit unnecessary?

Ken

User avatar
John Gray
PlatinumLounger
Posts: 5535
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Rezip

Post by John Gray »

In the days of FidoNet and PKZip there was a long thread on the former confidently asserting that the multiply-repetitive use of the latter would enable the perpetrator to gradually reduce the size of the resultant zipped-zipped-zipped...zip file to a minuscule amount. I don't remember whether the smallest possible size postulated was one byte or even one bit.

Unfortunately there were at least two snags:
a) trying to expand a multiply-zipped file of one bit or one byte clearly cannot restore the original file
b) the whole concept was flawed, utterly, because multiple zipping does not reduce the size of the zip file after the first couple of zip actions
This gave rise to the well-known response to such interesting theories: Why don't you try it? :scratch:
John Gray

A car crashed into a barrier at speed; nobody was injured, but a front wheel became detached, and slowly rolled down the road.
Driver [sings]: "You picked a fine time to leave me, Loose Wheel"​​

User avatar
ErikJan
BronzeLounger
Posts: 1337
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Rezip

Post by ErikJan »

JoeP wrote:
15 Aug 2023, 14:14
You could use a PowerShell script to unzip the files to a location and then invoke 7-Zip to recompress them to a location of your choice. PowerShell is capable of prompting for input(s) such as the file name/location and separately the password. There are many examples if you do a search. There is extensive documentation with sample scripts at Introduction to PowerShell.
I know this can be done with BAT files or other types of scripts. The problem is not simple as sometimes archive files can contain other archive files (etc.). I was hoping that by now someone would have 'cracked' this one...

User avatar
ErikJan
BronzeLounger
Posts: 1337
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Rezip

Post by ErikJan »

stuck wrote:
15 Aug 2023, 14:43
Surely the price of storage these days (I recently bought a 10 TB HDD for not a lot) makes the effort of re-zipping stuff to save only a few MBs a bit unnecessary?

Ken
I don't disagree, but I personally find it much more 'organized' in some cases if a lot of folders and files that I want to archive exist in only one file.
Also, backups are faster as files are smaller (and yes, I know that some backup programs can compress, but not as good as e.g. 7ZIP).

User avatar
ErikJan
BronzeLounger
Posts: 1337
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Rezip

Post by ErikJan »

John Gray wrote:
15 Aug 2023, 19:09
In the days of FidoNet and PKZip there was a long thread on the former confidently asserting that the multiply-repetitive use of the latter would enable the perpetrator to gradually reduce the size of the resultant zipped-zipped-zipped...zip file to a minuscule amount. I don't remember whether the smallest possible size postulated was one byte or even one bit.

Unfortunately there were at least two snags:
a) trying to expand a multiply-zipped file of one bit or one byte clearly cannot restore the original file
b) the whole concept was flawed, utterly, because multiple zipping does not reduce the size of the zip file after the first couple of zip actions
This gave rise to the well-known response to such interesting theories: Why don't you try it? :scratch:
Every set of data has a certain information content. With lossless compression (as we are talking about here) one cannot compress beyond a certainly level. E.g. with ZIP, the resulting file is often already quite random (and random can't be compressed because... well it's random), so further compression will be less effective.

JoeP
SilverLounger
Posts: 2155
Joined: 25 Jan 2010, 02:12

Re: Rezip

Post by JoeP »

Do I have this correct - If ZipfileA contains file1, file2, and ZipfileB you want to unzip ZipfileB, rezip ZipfileB, and then rezip ZipfileA? Of course, you'd have to recurse through ZipfileB to see if there was a ZipFileC, etc., etc.

I am not proficient enough in PowerShell to give you a sample but I'm pretty sure it can be done. PowerShell is an extremely powerful scripting tool.

You could try searching around at the PowerShell gallery.
Joe

User avatar
ErikJan
BronzeLounger
Posts: 1337
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Rezip

Post by ErikJan »

JoeP wrote:
20 Aug 2023, 02:04
Do I have this correct - If ZipfileA contains file1, file2, and ZipfileB you want to unzip ZipfileB, rezip ZipfileB, and then rezip ZipfileA? Of course, you'd have to recurse through ZipfileB to see if there was a ZipFileC, etc., etc.

I am not proficient enough in PowerShell to give you a sample but I'm pretty sure it can be done. PowerShell is an extremely powerful scripting tool.

You could try searching around at the PowerShell gallery.
Not sure... I'd like two main scenarios:
[1] Recompress all compressed files [1a] recursively [1b] just the top level
[2] Decompress all recursively and then recompress all into one compressed file

Of course then "Recompress" could be [3a] to the same type e.g. ZIP to ZIP, 7Z to 7Z of [3b] all to one type, e.g. 7Z

I'd like [2] and [3b] to 7Zip with max compression in most cases for myself... ;-)

Maybe in a few months -if and when I have more time- I'll have a go at it but -again- I was hoping I wouldn't be the first one :scratch:

jolas
3StarLounger
Posts: 213
Joined: 02 Feb 2010, 23:58

Re: Rezip

Post by jolas »

Try PeaZip.

User avatar
ErikJan
BronzeLounger
Posts: 1337
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Rezip

Post by ErikJan »

I know PeaZip and have tried it some years back. I scanned it recently again but I did not get the impression it could 're-pack' existing archives. Am I wrong? It's possible ;-)

jolas
3StarLounger
Posts: 213
Joined: 02 Feb 2010, 23:58

Re: Rezip

Post by jolas »

At least this version does it and can do batch convert. I did test it. Give it a whirl.

User avatar
ErikJan
BronzeLounger
Posts: 1337
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Rezip

Post by ErikJan »

It rezips allright, but it doesn't provide options for nested archive files