Link to home
Start Free TrialLog in
Avatar of Stephen Kairys
Stephen KairysFlag for United States of America

asked on

WINZIP - command line function to output directory of all zipped files

Hi,

Using WINZIP 21

Is there a command line function that will output all filenames contained in a ZIP file, including their path, to screen? I use WINZIP to back up a particular directory tree daily. Recently, the ZIP file size increased by apx. 45%, and I do not recall creating any huge files that would account for this discrepancy. Accordingly, being able dump a file list from this week, and from last week (when the file was smaller) would be useful.

Thanks,
Steve
Avatar of BillDL
BillDL
Flag of United Kingdom of Great Britain and Northern Ireland image

What version of WinZip do you have.  I use an older one where, as far as I recall, the "command line add-on" was installed as an optional component, whereas in much older versions you had to download and install it separately.


Knowledgebase - WinZip Command Line Support Add-On:
http://kb.winzip.com/kb/entry/125/

The command line program exe is "WZUNZIP.exe".
To see the syntax for the commands, type   WZUNZIP /?   or   WZUNZIP -?   or    WZUNZIP -h    in a Command window.

The following command line options were for an older version of WinZip, but should still apply.
To list the contents of a Zip file you would use the  -V   option:

-v[b|t] [r] [m] [c|d|e|n|o|p|s] [f]

View the list of files in the Zip file in one of the following formats: normal, brief, or technical. r reverses the sort order, while m (more) pauses after each screen. You can optionally sort by CRC, date, extension (file type), name, original order, percentage compression, or uncompressed size. The f option causes the date to be displayed in the format yyyy-mm-dd regardless of the local system's display settings.

wzunzip -v d:\temp\test.zip
This allows you to view the contents of the Zip file without unzipping it. A listing of the files and file information (File length, Compression method, file size, compression ratio, file date, file time, file CRC-32, file attribute, file name) are returned to the screen.

wzunzip -v d:\temp\test.zip >test.txt
Redirects all file information for test.zip and to a file called test.txt. This may be easier to read for long Zip files.

wzunzip -vb d:\temp\test.zip (brief file description)
A listing of the files and file information (File length, file size, compression ratio, file date, file time, file name) are returned to the screen.

wzunzip -vt d:\temp\test.zip (technical description)
Get a listing of the files and file information (File name, file type, attribute, file date and time stamp, compression method, compressed file size, uncompressed size, 32-bit CRC value, created by, needed to extract) returned to the screen.

wzunzip -vtr d:\temp\test.zip
Get a technical listing of files and show them in reverse sort order.

wzunzip -vm d:\temp\test.zip
Get a list of files contained within test.zip and display the list one screen at a time.

wzunzip -vtmd d:\temp\test.zip
Get a technical listing of files contained within the zip file and display one screen of data at a time. Sort the file information by date.

wzunzip -vbme d:\temp\test.zip
Get a brief listing of files contained in test.zip, display one screen of data at a time and sort the file listing by file type/extension.

I hope this helps.
Avatar of Stephen Kairys

ASKER

Hi, Bill,

I have WINZIP 21.

And, I already call it from the command line but as WZZIP.EXE, not WUNZIP.EXE.

I'll try your commands in detail later. Appreciate the help.

Steve
I hope you can get it working.  The reason I was a bit vague about the command line version is because the last version of WinZip that I paid a licence for is version 12.1 that I have on this old XP computer, and I installed it a long time ago,  I think I had to download the command line programs separately.

The options and switches I posted above are from the help file.  Notably, the   -V   switch is available for WZZIP and WZINZIP.
Another useful switch is -VI  (with m to view the info a page at a time) to "View the Zip file's internal information":
wzzip -vim d:\temp\test.zip

I now tend to use 7-Zip for command line operations rather than WinZip.  7-Zip allows you to replace the operator command (eg. a to add, e to extract, x to extract with full paths, etc) with  L   to "list" files inside an archive.
7z.exe l d:\temp\test.zip
7z.exe slt d:\temp\test.zip    (show technical information for l (List) command)
OK, so now I have my list (using the -V option) and I may have identified the large files. However, the filename given on the readout does not contain the path. Is there an option that will provide the full path?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of BillDL
BillDL
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No need to test 7-ZIP. -VT seems to work decently. Although it seems to give the RELATIVE path to...
set BaseDir=c:\FromOldPC\Freelance\Client

     Filename: _Za12840
     Filename: To-Do Lists\To-Do List 2017-01-17.docx


I can live with that, however. .Will see how this method works over the next day or two and then close question. Thanks!
On second thought:
The format with -VT produces the following format:

          Filename: _Za04256
         File type: binary
        Attributes: --w-*
     Date and Time: 02/22/2017 22:00
Compression Method: DeflatN
   Compressed Size: 424385090
 Uncompressed Size: 424321284
  32 bit CRC value: 274629ec
        Created by: 2.0 under MS-DOS, OS/2, NT FAT
 Needed to extract: 2.0 under MS-DOS, OS/2, NT FAT

          Filename: _Za12840
         File type: binary
        Attributes: --w-*
     Date and Time: 01/17/2017 22:08
Compression Method: DeflatN
   Compressed Size: 103574602
 Uncompressed Size: 103984249
  32 bit CRC value: f7c42ff2
        Created by: 2.0 under MS-DOS, OS/2, NT FAT
 Needed to extract: 2.0 under MS-DOS, OS/2, NT FAT

Open in new window


Not great for me b/c I wanted to sort by filesize, which can be done only if the format is one-file-per-line, as it is for -V

    Length     Method       Size     Ratio    Date     Time    CRC-32  Attr  Name
 ------------  ------   ------------ -----    ----     ----   -------- ----  ----
    103984249  DeflatN     103574602   1%  01/17/2017  22:08  f7c42ff2 --w-* _Za12840
    186412182  DeflatN     186440639   0%  02/03/2017  21:16  4d618636 --w-* _Za14512
    131233405  DeflatN     131169133   1%  02/03/2017  21:16  063a9539 --w-* _Za19448
          980  DeflatN           550  44%  02/08/2016  12:13  78fccc28 --w-* backup-pp.bat

Open in new window

Thanks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ah, yes EXAMDIFF. I have the free version installed, but had forgotten about it. Good call...I'll check it later. Thanks!

Good luck with the 'H' key! :)
Tanks :-)
Mystery solved!

The huge increase, which days later, was followed by a huge decrease was b/c of these _ZA files coming and going. Using EXAMDIFF with the -VT output worked very well.


    Length     Method       Size     Ratio    Date     Time    CRC-32  Attr  Name
 ------------  ------   ------------ -----    ----     ----   -------- ----  ----
    424321284  DeflatN     424385090   0%  02/22/2017  22:00  274629ec --w-* _Za04256
    103984249  DeflatN     103574602   1%  01/17/2017  22:08  f7c42ff2 --w-* _Za12840
    186412182  DeflatN     186440639   0%  02/03/2017  21:16  4d618636 --w-* _Za14512
    131233405  DeflatN     131169133   1%  02/03/2017  21:16  063a9539 --w-* _Za19448 

Open in new window


Goes to show you.  I wanted a one-line--per-item list which I was going to sort by filesize, but your method - which explicitly told me the diffs was was superior! :)

Btw, do you know if these _ZA files are some sort of tempfile used by WINZIP (which could be left behind if the program aborted)?

Thank you so much. Ended up being fun figuring this one out! :)

Steve
My first thoughts about the _ZA* files was an acronym for the firewall application "Zone Alarm", but its temp files are "ZL*.tmp" (Zone Labs).

Thinking about acronyms, ZA could easily be "Zip Archive", and could well be temp files created while WinZip is busy creating a zip file.  I am seeing references to a program named "Clever Zip" while searching for "_ZA", but no specific link to WinZip.  I think it is too coincidental to be anything other than WinZip related.

If you look at WinZip's Options menu > Configuration option > Folders tab, you should see: Working folder; CheckOut base folder; and Temp folder fields.  The WinZip help file explains them thus:

Working folder

When an existing Zip file is modified (for example, by adding files), WinZip must make a temporary copy of the Zip file. Normally, WinZip will create the temporary Zip file in the folder containing the open Zip file. If, however, the open Zip file is on removable media (e.g., diskettes), WinZip will create the temporary Zip file in the folder specified here. This is done because there may not be enough free space on the removable media to hold two copies of the file.  You can tell WinZip to use the specified folder for all Zip files, including those on nonremovable media, by unchecking the box labeled Use for removable media only.  The working folder is also used as a staging area when creating new Zip files on CD or DVD.

CheckOut base folder

If specified, WinZip uses this folder as the prefix for the default folder in the CheckOut dialog box. If this field is left blank WinZip will instead use the folder containing the open archive.

Temp folder

This entry specifies the location for temporary files created by WinZip, including files created during the View operation. If you run out of disk space during a View operation, change the Temp Folder to specify a drive and folder with sufficient free space.

I think that the default path for both the Working Folder and Temp folder is the user's Temp folder.

So there are circumstances where WinZip creates temp files in the same folder as an existing Zip File.  If you were using a batch file to update an existing Zip file with new files in the same folder, then I would guess that it might be possible for some of those temp files to be added to the zip file.

You would need a fairly lengthy process to allow you to switch over to Windows Explorer and see what files were being created while it was processing, or else you could use a utility program like Process Monitor to monitor this. (https://technet.microsoft.com/en-gb/sysinternals/processmonitor).  Process Monitor combines previously separate File Monitor and Registry Monotor programs, so it captures a huge amount of activity unless you filter it to exclude everything other than file monitoring.

Feel free to extract one of those _ZA* files from one of your Zip files and attach it here as a *.txt file.  The contents might be viewable in part using something like a hex editor and might reveal the origin of the files, but they could also reveal sensitive data.
Thanks. I'll have to extract a _ZA file from a previous ZIP file since all those files are gone. Will get back to this one during workweek. Thanks!
Apologies. Was on a deadline for a document release last week and now dealing with other projects. I have not forgotten about this issue and will respond hopefully within a week. Thanks.
You know what, at this point the _ZA files don't really matter to me. So, give me a few min. to review question and close out. Thanks.
Bill, thanks so much for your help, and apologies for the delayed response.

As to your comment I marked as ASSISTED SOLUTION, I did so specifically for the use of EXAMDIFF. I did not explore any of the other option(s), so for anyone reading this I can't vouch for how well they'd have worked.

Thanks again.
Thank you Stephen.  I am glad that you have found some of the comments and suggestions helpful