Created
January 19, 2011 16:30
-
-
Save comewalk/786409 to your computer and use it in GitHub Desktop.
extract all zip files in the directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set objShell = CreateObject("Shell.Application") | |
Set objWshShell = CreateObject("WScript.Shell") | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set folder = fso.GetFolder(objWshShell.CurrentDirectory) | |
Set files = folder.Files | |
For each folderIdx In files | |
ZipFile=folderIdx.Name | |
ExtName = LCase(fso.GetExtensionName(folderIdx.Name)) | |
If ExtName = "zip" Then | |
ExtractTo=objWshShell.CurrentDirectory | |
If NOT fso.FolderExists(ExtractTo) Then | |
fso.CreateFolder(ExtractTo) | |
End If | |
'Extract the contants of the zip file. | |
Set FilesInZip=objShell.NameSpace(objWshShell.CurrentDirectory & "\" & ZipFile).items | |
objShell.NameSpace(ExtractTo).CopyHere(FilesInZip) | |
End If | |
Next | |
Set objWshShell = Nothing | |
Set objShell = Nothing | |
Set fso = Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment