Extract zip file using vbscript

Various VB Scripts
Post Reply
thockman
Site Admin
Posts: 104
Joined: Thu Dec 15, 2005 5:51 pm
Location: Kansas City
Contact:

Extract zip file using vbscript

Post by thockman » Wed Jun 01, 2011 2:02 pm

Code: Select all

' Author: Troy Hockman
' Desc:   Simple script to extract windows zip file

' Change variables to your likeing
ZipFile="C:\temp\Sysinternals.zip"
ExtractTo="C:\temp"

'If the extraction location does not exist create it.
Set objFSO = CreateObject("Scripting.FileSystemObject")
If NOT objFSO.FolderExists(ExtractTo) Then
   objFSO.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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest