You could also:
Code:
$HABObject = createobject("HBullock.AdminObjects")
if vartypename($HABObject1) <> "Object"
? "@serror"
endif
$Zip1 = $HABObject.Zip("C:\Data\Download\BBchecker.zip")
$num = $Zip1.numberOfMembers
? @serror
? "Num of files in archive: " + $num
?
; Output list of files in the archive
; Note the use of the "List" method to make the array. This is case sensitive.
$files = $Zip1.List.memberNames
$x=1
for each $member in $files
? "" + $x + ": " + $member
$x = $x + 1
next
; Get a file from the archive as an object
?
$file = "view.kix"
$member = $Zip1.memberNamed( $file )
? "compressionMethod = " + $member.compressionMethod
? "lastModFileDateTime = " + $member.lastModFileDateTime
? "crc32string = " + $member.crc32String
? "uncompressedSize = " + $member.uncompressedSize
? "compressedSize = " + $member.compressedSize
; Extract file to a specified location.
?
$rc = $member.extractToFileNamed( "C:\Data\Scripts\PerlCtrl\objects\" + $file )
if $rc = 0
? "Extraction was successful"
else
? "Extraction Failed: $rc @serror"
endif
?
$Zip2 = $HABObject.Zip()
$files = "C:\Data\Scripts\PerlCtrl\objects\Zip.html",
"C:\Data\Scripts\PerlCtrl\objects\HABobjects2.DLL",
"C:\data\scripts\[censored].kix"
for each $file in $files
$member = $Zip2.addFile( $file )
if $Zip2.writeToFileNamed( "C:\Data\Scripts\PerlCtrl\objects\Test.zip" ) = 0
? "Added: " + $file
endif
next