home *** CD-ROM | disk | FTP | other *** search
/ Chip 2009 November / Chip_2009.11_CD.iso / Chip_WPI / WPIScripts / ExtractToPath.vbs < prev    next >
Encoding:
Text File  |  2006-11-14  |  760 b   |  21 lines

  1. dim ZipEXE, zipArchive, cmdLine, wpipath, root, destination
  2.  
  3. set oFso=createobject("scripting.fileSystemObject")
  4. Set oShell = CreateObject("WScript.Shell")
  5. set objArgs = WScript.Arguments    'Command line arguments
  6.  
  7. wpipath = oFso.getAbsolutePathname("")    'Get working directory where this script is run
  8. root=oFso.GetParentFolderName(wpipath)
  9.  
  10. if WScript.Arguments.Count > 1 then    'WScript.Echo "Total number of arguments: " & WScript.Arguments.Count
  11.     zipArchive = chr(34) + WScript.Arguments( 0 ) + chr(34)
  12.     destination = chr(34) + WScript.Arguments( 1 ) + chr(34)
  13. else
  14.     WScript.Quit
  15. end if
  16.  
  17. zipEXE = chr(34) + wpipath + "\Tools\7z\7z.exe" + chr(34)
  18. cmdLine = zipEXE + " x " + zipArchive + " -aoa -o" + destination
  19.  
  20. oShell.Run cmdLine, 0, True
  21.