Rezip
-
- BronzeLounger
- Posts: 1337
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Rezip
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).
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).
-
- Panoramic Lounger
- Posts: 8543
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: Rezip
Isn't this sort of thing that AutoIt can do?
http://www.autoitscript.com/site/autoit/
he says confidently as if he knows what he's talking about when he's never actually used AutoIt himself
Ken
http://www.autoitscript.com/site/autoit/
he says confidently as if he knows what he's talking about when he's never actually used AutoIt himself
Ken
-
- SilverLounger
- Posts: 2155
- Joined: 25 Jan 2010, 02:12
Re: Rezip
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
-
- PlatinumLounger
- Posts: 5535
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Rezip
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?
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?
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"
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"
-
- BronzeLounger
- Posts: 1337
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Rezip
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...JoeP wrote: ↑15 Aug 2023, 14:14You 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.
-
- BronzeLounger
- Posts: 1337
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Rezip
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).
-
- BronzeLounger
- Posts: 1337
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Rezip
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.John Gray wrote: ↑15 Aug 2023, 19:09In 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?
-
- SilverLounger
- Posts: 2155
- Joined: 25 Jan 2010, 02:12
Re: Rezip
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.
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
-
- BronzeLounger
- Posts: 1337
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
Re: Rezip
Not sure... I'd like two main scenarios:JoeP wrote: ↑20 Aug 2023, 02:04Do 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.
[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