How to unzip a password-protected file in vbscript?

前端 未结 1 826
时光说笑
时光说笑 2021-01-25 19:23

I am fairly new to VBScript. I have done some extensive research on what I am trying to accomplish and have even found examples of what to do, but cannot get it to work properly

相关标签:
1条回答
  • 2021-01-25 19:59

    If you take a closer look at the answer from which the pwd+... came, you'll notice that pwd does not contain a password, but a path. The variable was probably named after the Unix command pwd, which stands for "print working directory".

    As far as I know the Shell.Application object does not support unpacking password-protected Zip files. Another answer to the question you referenced suggests the DotNetZip library. Or you could use 7-zip:

    Function qq(str)
      qq = Chr(34) & str & Chr(34)
    End Function
    
    zipfile  = "..."
    password = "..."
    
    Set sh = CreateObject("WScript.Shell")
    sh.Run "7za.exe x " & qq(zipfile) & " -p" & qq(password), 0, True
    
    0 讨论(0)
提交回复
热议问题