# Script to install Google Chrome browser on Windows devices

Google Chrome, over the years, has become one of the most popular browsers for its uninterrupted service and user-friendly interface. Using the script given below, organizations can silently download and install the latest version of Chrome browser to their Windows devices without any user intervention. Hexnode lets admins automate this process with the help of [Execute Custom Script](https://www.hexnode.com/mobile-device-management/help/executing-custom-scripts-for-windows/) action.

 Disclaimer:The sample scripts provided below are adapted from third-party open-source sites.

 

### Batch script

The Batch script to silently download and install the latest version of the chrome browser is given below:

Batch script to install chrome on windows

echo Set o=CreateObject^("MSXML2.XMLHTTP"^):Set a=CreateObject^("ADODB.Stream"^):Set f=Createobject^("Scripting.FileSystemObject"^):o.open "GET", "https://dl.google.com/chrome/install/chrome\_installer.exe", 0:o.send^(^):If o.Status=200 Then >"%temp%\\d.vbs" &echo a.Open:a.Type=1:a.Write o.ResponseBody:a.Position=0:If f.Fileexists^("%temp%\\s.exe"^) Then f.DeleteFile "%temp%\\s.exe" >>"%temp%\\d.vbs" &echo a.SaveToFile "%temp%\\s.exe" >>"%temp%\\d.vbs" &echo End if >>"%temp%\\d.vbs" &cscript //B "%temp%\\d.vbs" &del /F /Q "%temp%\\d.vbs" &start "" "%temp%\\s.exe"

   1

  echo Set o=CreateObject^("MSXML2.XMLHTTP"^):Set a=CreateObject^("ADODB.Stream"^):Set f=Createobject^("Scripting.FileSystemObject"^):o.open "GET", "https://dl.google.com/chrome/install/chrome\_installer.exe", 0:o.send^(^):If o.Status=200 Then >"%temp%\\d.vbs" &echo a.Open:a.Type=1:a.Write o.ResponseBody:a.Position=0:If f.Fileexists^("%temp%\\s.exe"^) Then f.DeleteFile "%temp%\\s.exe" >>"%temp%\\d.vbs" &echo a.SaveToFile "%temp%\\s.exe" >>"%temp%\\d.vbs" &echo End if >>"%temp%\\d.vbs" &cscript //B "%temp%\\d.vbs" &del /F /Q "%temp%\\d.vbs" &start "" "%temp%\\s.exe"

   

 

  

### PowerShell script

PowerShell script to install chrome on windows

$Path = $env:TEMP; $Installerchrome = "GoogleChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome\_installer.exe', "$Path\\$Installerchrome"); & "$Path\\$Installerchrome" /silent /install; $ProcesstoMonitor = "GoogleChromeInstaller"; Do { $ProcessFound = Get-Process | ?{$ProcesstoMonitor -contains $\_.Name} | Select-Object -ExpandProperty Name; If ($ProcessFound) { "Still running: $($ProcessFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$Path\\$Installerchrome" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessFound) 

   1

2

3

4

5

6

7

8

9

10

11

12

13

  $Path = $env:TEMP;

$Installerchrome = "GoogleChromeInstaller.exe";

(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome\_installer.exe', "$Path\\$Installerchrome");

& "$Path\\$Installerchrome" /silent /install;

$ProcesstoMonitor = "GoogleChromeInstaller";

Do

{ $ProcessFound = Get-Process | ?{$ProcesstoMonitor -contains $\_.Name} | Select-Object -ExpandProperty Name;

If ($ProcessFound) { "Still running: $($ProcessFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 }

else

{ rm "$Path\\$Installerchrome" -ErrorAction SilentlyContinue -Verbose } }

Until (!$ProcessFound) 

   

 

  

The chrome browser gets silently downloaded and installed with the Chrome icon appearing on the Desktop.

 Notes:- Make sure your Windows 10/11 computer system is connected with the internet during script deployment.
- It is recommended to manually validate the script execution on a system before executing the action in bulk.
- Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.