Advertisement
Yunga

download-chrome.vbs

Aug 7th, 2013
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.07 KB | None | 0 0
  1. ' Where to save chrome, and the URL of the chrome EXE.
  2. strHDLocation = "c:\ChromeStandaloneSetup.exe"    
  3. strFileURL="https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7BA024641A-81C0-533A-53CB-AE9534821219%7D%26lang%3Den%26browser%3D4%26usagestats3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dfalse%26installdataindex%3Ddefaultbrowser/update2/installers/ChromeStandaloneSetup.exe"
  4.  
  5. ' Fetch the file
  6. Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
  7. objXMLHTTP.open "GET", strFileURL, false
  8. objXMLHTTP.send()
  9.  
  10. If objXMLHTTP.Status = 200 Then
  11.     Set objADOStream = CreateObject("ADODB.Stream")
  12.     objADOStream.Open
  13.     objADOStream.Type = 1 'adTypeBinary
  14.     objADOStream.Write objXMLHTTP.ResponseBody
  15.     objADOStream.Position = 0 'Set the stream position to the start
  16.    
  17.     Set objFSO = Createobject("Scripting.FileSystemObject")
  18.     If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
  19.  
  20.     Set objFSO = Nothing
  21.     objADOStream.SaveToFile strHDLocation
  22.     objADOStream.Close
  23.     Set objADOStream = Nothing
  24. End if
  25.  
  26. Set objXMLHTTP = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement