Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 , strZipPath
- cscript UnzipZip.vbs
- C:UsersBrettDownloadsUnzipZip.vbs(12, 1) Microsoft VBScript runtime error: Object required: 'objShell.NameSpace(...)'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement