Category filter
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 action.
Batch script
The Batch script to silently download and install the latest version of the chrome browser is given below:
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
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.