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.

22 thoughts on “Download Google Chrome Without a Web Browser using Windows Command Line

  1. Hey thanks for this invaluable info man! ive been looking to download google chrome without a browser for ages, Quality post.Thanks

    Like

  2. I wouldn’t use C: Admin right required for C: many people don’t know this so I’d use a USB Drive.
    Also Type mismatch on line 17. Move it to end of line 16. Other than that it works great.

    Like

  3. Love the site! With the Google Chrome VBS file I had to delete line 17 and it then worked on my system. I am not sure if it was specific to me, but I am running Windows XP Media Center with all updates. The link for the chrome installer still works too! Keep up the great work!

    Like

  4. Hey Shaun or Matt.

    Could you help me out? I am smart, but know nothing of programming. I had to type it all up (as I had no way of cutting and pasting w/o internet access) and I proofed it. I am getting an error that sounds like what Shaun was talking about and I did not quite understand how Shaun meant to correct the error. (I tried just deleting line 17 as the previous poster stated but that didn’t work.)

    Noah

    Like

  5. This is useful to me … I do data recovery and often have to re-install Windows and prep the machine for the owner. If I fetch Chrome with this I don’t have to start Internet Explorer up at all. When I need the correct URL I look it up with Chrome (on my Macbook Pro, I don’t ever actually use those ol’ Windows these days).

    Like

  6. Hi Matt,
    Thanks for the script. Works great!
    I am trying to modify it to download beta and dev releases, but it doesn’t work. Can you tell me how you got the strFileURL? I can’t figure out a pattern to get URLs for beta/dev.

    Like

  7. I get the (17,1) Microsoft VBScript runtime error: Type mismatch: ‘strHDLocation’. So I tried Shauwn LaLnde’s suggestion to move line 17, ‘strHDLocation’ to end of line 16. I now get this error: “ADODB.Stream Write to file failed.” I would very much appreciate any suggestion. Both my Chrome and IE browser got killed by some malicious file I tried to download. So my only access now is my notebook PC. By the way this notebook is on a home network with my desktop, and my browsers are okay on the notebook. Anyway to take advantage of that?

    Like

  8. Ignore my request for help. My “duh” afterthought about downloading a standalone start-up file to this notebook via my home network. I did that and all is well now on both PC’s.

    Like

  9. After I tried this as written it failed on line 17 so I moved line 17 to the end line 16 as per Shauwn LaLnde. Then it failed again on line 18 (which was originally line 19 above) with Write to file failed.
    Can anyone help me, please?

    Like

  10. For those getting an error about strHDLocation, it is because of this:

    If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile
    strHDLocation

    It should be on one line:
    If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation

    Like

  11. How am I supposed to copy and and paste all of this code, on my computer, without access to the internet to get to your blog??? Makes no sense.

    Like

  12. Thanks for posting this info. The link to Chrome executable worked. After it downloaded, I copied it to a thumb drive and installed it on a PC that had been reset to how it came from Dell. The reset IE was release 7 and it would fail whenever attempting to download a new browser, even a new IE.

    Like

  13. But–

    I wonder exactly how Windows actually fulfills the objXMLHTTP request.

    Isn’t it sort of likely that it probably uses I IE or else some sort of DefaultWebBrowser system setting?


    Furry cows moo and decompress.

    Like

  14. I can confirm this worked on Windows 10 (updated) after some system bug made Windows hang after booting up and seemingly corrupted all browsers installed after I restarted it.
    However I also had the error message, which was fixed after I simply cut line 17 (as in the example) and pasted it at the end of line 16.
    Sadly, the installation closes abruptly and the problem persists (can’t start any browser, instant error message)

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s