Unzip files in VBScript

Author Message
umesh.bg

  • Total Posts : 34
  • Scores: 0
  • Reward points : 0
  • Joined: 1/12/2011
  • Status: offline
Unzip files in VBScript Wednesday, January 12, 2011 6:24 PM (permalink)
0
Hi
I want to unzip files in Vbscript in silent mode what is the code for that.
i can unzip files with the following code but cant able to make it in sailent mode...
While extracting files it will popup one window.. i dont want to display that window...
The below code it will extract the folder how can i modify it in to silent mode....
 
ZipFile="D:\ABC\RST\Project.zip"
ExtractTo="D:\ABC\"
'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
 
Thanks for your help in advance
 
 
#1
    umesh.bg

    • Total Posts : 34
    • Scores: 0
    • Reward points : 0
    • Joined: 1/12/2011
    • Status: offline
    Re:Unzip files in VBScript Thursday, January 20, 2011 6:42 PM (permalink)
    0
    Hi I found a solution to unzip files in vbscript in silent mode with 7-Zip installation the below is the code:
    
    Dim ABC, XYZ
    ABC="D\Files\Folders"  'Path for where the zip file is present
    xyz="D:\Test"               'Path where to extract the file
    Set WshShell=CreateObject("Wscript.Shell")
    ret=WshShell.Run("""C:\Program Files\7-Zip\7z.xex"" x -aoa -r " & ABC & "\files.Zip -o" & XYZ & "\Project",0,True)
     
    'Zip file path is = "D\Files\Folders\files.zip"
    'Extracted path is = "D:\Test\Project\files"
     
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9