[英]Error unzipping with VBS
我有這個 VBS解壓縮文件:
Set args = Wscript.Arguments
outputDirectory = WScript.Arguments.Item(0)
zipFile = WScript.Arguments.Item(1)
rem On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
If NOT fso.FolderExists(outputDirectory) Then
fso.CreateFolder(outputDirectory)
End If
set objShell = CreateObject("Shell.Application")
set FilesInZip=objShell.NameSpace(zipFile).items
objShell.NameSpace(outputDirectory).CopyHere(FilesInZip)
Set fso = Nothing
Set objShell = Nothing
rem On Error Goto 0
問題是,當我從.bat運行它時:
%zip_vbs_path% "%cd%\\%zip_temp_dir%\\" "%cd%\\%OUTPUT_DIR%\\!zip_plugin_name_!"
哪里:
%zip_vbs_path
是所述VBS的路徑 %zip_temp_dir%
= zip_temp
%OUTPUT_DIR%\\!zip_plugin_name_!
= Output\\PluginName.jar
我收到此錯誤:
在提交答案時,請ELIF ,因為我根本不熟悉VBS語言。
對於這一行:
set FilesInZip=objShell.NameSpace(zipFile).items
你有zipFile
設置為:
Output\PluginName.jar
您正在使用的代碼應該適用於zip
文件,但Shell.Application
無法從jar
文件中檢索文件集合。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.