We help IT Professionals succeed at work.

switch in winzip -o  what is it in 7zip

cgds1
cgds1 asked
on
When using 7zip trying to keep the modified date on the  zipped file the same as the source file
Comment
Watch Question

Developer
Fellow 2017
Most Valuable Expert 2018
Commented:
I've seen this feature requested before (in some cases, years ago), but as far as I know, it still has not been implemented. The latest thread I could find about it in the SourceForge discussions is this:
http://sourceforge.net/p/sevenzip/discussion/45798/thread/bae27baf/

Note that Igor Pavlov himself (the author of 7-Zip) jumped into the thread, but was noticeably silent at the end of the thread when it turned to discussing the need for an option that would set the date of the archive to the most recent date of the file(s) that it contains.

My advice is to write a program/script to do this after you're done zipping it. You could even use the 7-Zip command line interface with the "l" (List) command to create a plain text file with the contents of the archive by redirecting the output to a file. For example:

7z l d:\path\archive.zip>d:\path\archivecontents.txt

That will create a text file with info like this:

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2012-01-12 08:35:54 ....A       108736        20767  scanner.bmp
2014-09-15 17:15:48 ....A      1232194      1199574  setup.exe
2013-12-06 10:29:22 ....A        11121         3337  setup.ini
2014-11-04 12:01:02 ....A          872          442  setup.txt
2014-04-16 09:56:36 ....A      1599272       750931  setupja.exe
2014-01-23 20:48:38 ....A       110592        56512  buttonapp\killkss.exe
2014-05-26 23:30:02 ....A    202077866    201328657  buttonapp\setup.exe
2014-12-15 12:31:44 D....            0            0  documentation\English
2014-07-01 08:25:26 ....A      1354031      1244189  documentation\English\User's Guide.pdf
2014-12-15 12:31:44 D....            0            0  documentation\French
2014-05-14 17:07:40 ....A       836290       764039  documentation\French\User's Guide.pdf
2014-12-15 12:31:46 D....            0            0  integrator\Kodak
2013-11-12 12:45:54 ....A        37488         6636  integrator\Kodak\debugging.htm
2013-11-12 12:45:40 ....A       264198        31554  integrator\Kodak\faq.htm
2013-11-12 12:45:26 ....A        51324         9127  integrator\Kodak\GettingStarted.htm

Open in new window


A program/script could easily sort by the Date/Time columns (which, btw, are the Modified time stamps — exactly what you want) and then set the date of the archive to the newest file. Regards, Joe
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
The selected post explains exactly how to do it.