06-29-2016, 02:19 PM
(This post was last modified: 06-29-2016, 02:20 PM by Ankesh.
Edit Reason: Added code block
)
You can use the below code.
Code:
Function UnzipFile(zipFile,ExtractTo)
'The location of the zip file.
'ZipFile="C:\Test.Zip"
'The folder the contents should be extracted to.
'ExtractTo="C:\Test\"
'If the extraction location does not exist create it.
Set fso = CreateObject("Scripting.FileSystemObject")
If NOT fso.FolderExists(ExtractTo) Then
fso.CreateFolder(ExtractTo)
End If
'Extract the contants of the zip file.
set objShell = CreateObject("Shell.Application")
set FilesInZip=objShell.NameSpace(ZipFile).items
objShell.NameSpace(ExtractTo).CopyHere(FilesInZip)
Set fso = Nothing
Set objShell = Nothing
End Function