Download Google Chrome Without a Web Browser using Windows Command Line

Due to the popularity of my old post on how to download firefox without a web browser, I decided to figure out a way to do the same thing with Chrome.  Chrome doesn’t seem easily accessible on FTP, so this method allows you to still download Chrome from a safe web source, via the HTTP link that Google provides.

1.  Open NotePad and paste the below VBScript code into it.

Note: The strFileURL variable is currently set to the URL that Chrome is at as of today.  That might change later.  Find latest Chrome EXE by going here. Click accept and install, then right-click copy the URL titled “Click here to retry.”

' This is the URL of the chrome EXE.
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"
' This is where the file will download to.
strHDLocation = "c:ChromeStandaloneSetup.exe"
' Fetch the file
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile
strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End if
Set objXMLHTTP = Nothing

2. Save your notepad file to your desktop, and use quotes in the filename to overwrite saving as a .txt file:
“chrome.vbs”

3. Go to your Windows command prompt (Start > CMD)
4. Navigate to your desktop in the command prompt (cd desktop)
5. Run the command: cscript.exe downloadfile.vbs

6. Open Windows explorer, and right on your C drive you should see the chrome installer at c:ChromeStandaloneSetup.exe


Attribution: This vbscript was adopted by Gareth’s method on SuperUser.com.