Error in zip from WinZIP after zipping with powershell

Jul 13, 2012 at 7:00 PM

Used this line:

e:\batch\zipsplitDir.ps1 f:\TO\BAD\Test20120711.zip e:\\bcp Iszx!99Ka7!CSedFktbkoF4wp6UoWS7+d_:5bf298@p0@NXVzdWrY9vR5tDF!u6waDRm9UTqGrsy6igN1svOT89ir3rf5R

 to run the below Powershell code on Windows 2003 R2 64-bit Server:
 
 Param($Param1,$Param2, $Param3)
$StopWatch=new-object system.diagnostics.stopwatch
$stopWatch.start()

# PARAM1 NameOfSpits
# Param2 NameOfDirectory
# Param3 Name of Pass

$Param1
$Param2
$Param3
[System.Reflection.Assembly]::LoadFrom("E:\DotNetZip\Ionic.Zip.dll")
    $zipfile =  new-object Ionic.Zip.ZipFile
    $zipfile.Encryption = [Ionic.Zip.EncryptionAlgorithm]::WinZipAes256
    $zipfile.Password = "$Param3"
    $zipfile.UseZip64WhenSaving = [Ionic.Zip.Zip64Option]::AsNecessary
    $zipfile.MaxOutputSegmentSize = 1073741824
    $zipfile.AddDirectory("$Param2")
#   $e=$zipfile.addfile("$Param2")
    $zipfile.Save("$Param1")
   
$stopWatch.Stop()
$ts = $stopWatch.Elapsed
$ElapsedTime = [system.String]::Format("{0:00}:{1:00}:{2:00}.{3:00}", 
           $ts.Hours, $ts.Minutes, $ts.Seconds, 
            $ts.Milliseconds / 10); 
"Runtime = $elapsedTime" 


Took approximately 45 minutes to produce a 12 piece zip file.

Open the zip file with WinZIP and tried to extract zip file and got message:

Error #17; bad Zip file offset (Error local header signature not found): disk #1 offset:57007199.
Would you like WinZip to try to continue with the next file?  Yes or no
Yes does allow you to keep unziping files.


BCP contained 292 objects 105 GB
some object small the larges object 58GB.

Is there something I can do to properly create the zip for use with WinZIP?

I notice that the files are not in sequential order by date time:

07/13/2012  12:24 PM     1,073,741,824 Test20120711.z01
07/13/2012  12:28 PM     1,073,741,824 Test20120711.z03
07/13/2012  12:31 PM     1,073,741,824 Test20120711.z04
07/13/2012  12:34 PM     1,073,741,824 Test20120711.z05
07/13/2012  12:37 PM     1,073,741,824 Test20120711.z06
07/13/2012  12:39 PM     1,073,741,824 Test20120711.z02
07/13/2012  12:41 PM     1,073,741,824 Test20120711.z07
07/13/2012  12:42 PM     1,073,741,824 Test20120711.z08
07/13/2012  12:45 PM     1,073,741,824 Test20120711.z09
07/13/2012  12:46 PM     1,073,741,824 Test20120711.z10
07/13/2012  12:49 PM     1,073,741,824 Test20120711.z11
07/13/2012  12:49 PM       636,144,121 Test20120711.zip
              12 File(s) 12,447,304,185 bytes


I had to use WinZIp to complete the archive instead.

Otherwise --Great software!

Love that you can script in  Powershell wish there were more examples
Seem faster that the old version of Winzip I currently have access to.


Thanks for everything!