我有一個vbscript提取多個zip文件到不同的位置。該代碼只適用於一個文件。這個文件不起作用,恰好大於6GB。我正在處理的下一個最大的文件大約是3.5GB。在VBScript中使用CopyHere是否存在大小限制的.zip文件?
下面是代碼片段;
strFileDest = "path\to\some\dir1"
strZIPname = "file1.zip"
Call UnPack(strFileDest, strZIPname)
strFileDest = "path\to\some\dir2"
strZIPname = "file2.zip"
Call UnPack(strFileDest, strZIPname)
Function UnPack(strZIPdest, strZIPname)
Dim intOptions, objShell, objSource, objTarget
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
sSourceFile = objFSO.GetAbsolutePathName(strZIPname)
Set objSource = objShell.NameSpace(sSourceFile).Items()
Set objTarget = objShell.NameSpace(strZIPdest)
intOptions = 256
If objFSO.FolderExists(strZIPdest) Then
objTarget.CopyHere objSource, intOptions
Else
MsgBox "Cannot complete unzip for " & strZIPname & ". The destination _
directory (" & strZIPdest & ") could not be located.", 0, "Invalid"
End If
End Function
我已經採取了更小的壓縮並更名爲將不可複製的拉鍊。使用新的大小,腳本將解壓該文件,證明該文件的其餘腳本可以工作。我也已通過手動提取證實了該zip是有效的。當我使用指向大型zip的腳本運行腳本時,我也沒有收到任何錯誤(我沒有使用 On Error resume next)。
感謝您的鏈接;研究一種解壓方法時,我確實登陸了你的頁面。雖然我使用的客戶端已經安裝了7zip,但我並不願意使用它來支持使用本地方法。儘管我可能會沿着這條路走下去。 – s3d83d