The '-vbf' options are the switches for listing the file contents; check the WinZip helpfiles, which explain all the command-line switches. The last portion of the string is a DOS trick which 'pipes' the results out to a textfile (I learned this from my boss - don't know where it's documented, but it works).
*************
- Then, write the command string out to a batch file, and execute the batch file with a Windows Script Host shell command. This seems like an extra step...but for some reason (the pipe-command I guess, since the WinZip command string alone runs fine with the WiSH.Run command) prevents WSH from running correctly, although no error is generated.
Create Windows Script Host object:
Set oWiSH = CreateObject("WScript.Shell"
Create FileSystemObject (to write command-string to batch file)
Set oFSO = CreateObject("Scripting.FileSystemObject"
Set oFile = oFSO.CreateTextFile(sBatchFile, True)
oFile.WriteLine (scmd)
iZipErrCode = oWiSH.Run(sBatchFile, 7, True)
**************
The result is a textfile containing a list of the files in the zip archive. If you want to do anything with the list you'll have to parse the file, as there's a lot of other crap in there besides the filenames.
I think I have the parsing code somewhere if you want it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.