Tôi biết rất ít về bash hoặc vbs. Tôi đang cố gắng tạo một tập lệnh sẽ tự động giải nén một zip có tên là 'dungeon.zip', trong đó có một trò chơi nhỏ mà tôi đã lập trình. Tôi muốn giải nén nó vào một thư mục có tên là dungeon trong cùng thư mục chứa tệp zip. Tôi đã sử dụng mã từ câu trả lời này và thay thế các tệp bằng các tệp của mình:
strZipFile  = "dungeon.zip"
strUnzipped = "dungeon\"
Sub UnZip(ExtractTo,ZipFile)
Set fso = CreateObject("Scripting.FileSystemObject") 
    If NOT fso.FolderExists(ExtractTo) Then 
       fso.CreateFolder(ExtractTo) 
End If 
Set objShell = CreateObject("Shell.Application") 
Set FilesInZip=objShell.NameSpace(ZipFile).items 
ObjShell.NameSpace(ExtractTo).CopyHere(FilesInZip) 
Set fso = Nothing 
Set objShell = Nothing 
End Sub
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("MyDocuments")
strZipPath   = strDesktop & strZipFile
strUnzipPath = strDesktop & strUnzipped
UnZip strUnzipPath , strZipPathNhư trong câu trả lời của anh ấy, tôi chạy .vbs từ tệp cmd:
cscript UnzipZip.vbsĐây là lỗi:
C:\Users\Brett\Downloads\UnzipZip.vbs(12, 1) Microsoft VBScript runtime error: Object required: 'objShell.NameSpace(...)'Còn ý tưởng nào để sửa cái này nữa không?