📜  vbscript 用密码 winzip 文件 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:02.133000             🧑  作者: Mango

代码示例1
strWinZipDir = "C:\Program Files\WinZip\WINZIP64.exe"
strZipFileToCreate = LocalPath & "FileName.zip"
strFilesToZip  = LocalPath & "*.txt"

Set objFSO = CreateObject("Scripting.FileSystemObject")

strWinZip = objFSO.GetFile(strWinZipDir).ShortPath
strCommand = strWinzip & " -min -a -s""Password"" -r """ & strZipFileToCreate & """ " & strFilesToZip

Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec(strCommand)

Do While objExec.Status = 0
 Wscript.Sleep(200)
Loop

Set objShell = Nothing
Set objExec = Nothing
Set objFSO = Nothing