Since 1998, I've enjoyed using a batch file I created that redates many ZIP archives to the date/time stamp of the latest file from within each ZIP. Now it's RAR's chance to come to the fore!
For WinZIP command-line PkZip25.exe (15-04-98 02:50) from Pk250c32 of PKWARE Inc., there is a 'switch' (-zipdate=newest) that lets me do this nicely and reasonably elegantly.
Code snippet from my batch file:
for %%i in ("*.zip") do C:\Utils\PkZip25.exe "%%i" -silent -zipdate=newest -del nul
I simply position within the directory I wish to manipulate, then run the batch file. It's all over and done within seconds.
Pk250c32 Syntax snippet:
-zipdate - set the file modification date of the .ZIP file.
=newest - set to the date of the "newest" file within the .ZIP file.
=oldest - set to the date of the "oldest" file within the .ZIP file.
=retain - retain the original date of the .ZIP file (the date on which the .ZIP file was created).
=none - disable the .ZIP file date in the config file, and set the .ZIP date as the last modification date.
-----------------------------
=default = the current date.
default if used on command line without a sub-option = retain
Now, there's been many frustrating moments when I would have wished to do exactly the same for RAR files, rather than manually changing the current downloaded date and time backwards to the actual (latest) date/time, making it often easier to determine amongst many files which ones really are the newest.
Can someone please help me?
Redating many RAR archives to latest file inside each RAR
Redating many RAR archives to latest file inside each RAR
You do not have the required permissions to view the files attached to this post.
Re: Redating many RAR archives to latest file inside each RA
Hi DannyR49
And you need this when not using other commands
Update:
But you should know that the .RAR file is modified and stuff like "authenticity verification" is removed, but your .ZIP command seems to modify the .ZIP file also.
This seems to do what you wantDannyR49 wrote:Code snippet from my batch file:
for %%i in ("*.zip") do C:\Utils\PkZip25.exe "%%i" -silent -zipdate=newest -del nul
Code: Select all
for %%i in ("*.rar") do C:\Utils\rar ch -tl -inul "%%i"
Code: Select all
-tl Set archive time to latest file
-inul Disable all messages
Code: Select all
ch Change archive parameters
But you should know that the .RAR file is modified and stuff like "authenticity verification" is removed, but your .ZIP command seems to modify the .ZIP file also.
Redating many RAR archives to latest file inside each RAR
Thankyou so much JoniB. It works like a treat, no mods to do whatsoever.
I guess I was looking at UnRAR's switches, instead of getting out of the square and looking at RAR's switches.
Your extra switches to use in this mode worked perfectly - thanks again.
I guess I was looking at UnRAR's switches, instead of getting out of the square and looking at RAR's switches.
Your extra switches to use in this mode worked perfectly - thanks again.