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.
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:
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"
|