+ Reply to Thread
Results 1 to 2 of 2

Thread: zip and unzip files with vbs

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    31

    zip and unzip files with vbs

    I want to zip and un-zip files using vbs , how can that be achieved ?

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    13
    To zip files :
    Code:
    FolderToZip = "C:\folder" 
     zipFile = "C:\folder.zip" 
    
     set sa = CreateObject("Shell.Application") 
     Set zip= sa.NameSpace(zipFile) 
     Set Fol=sa.NameSpace(FolderToZip) 
     zip.CopyHere(Fol.Items)
    To unzip files :
    Code:
    pathToZipFile="C:\folder.zip" 
     extractTo="C:\" 
    
     set sa = CreateObject("Shell.Application") 
     set filesInzip=sa.NameSpace(pathToZipFile).items 
     sa.NameSpace(extractTo).CopyHere(filesInzip)

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts