My company doesnt allow powershell. So i tried to cmd and use a task scheduler to download.
- Link is correct, able to download
- Unable to create new folder
- Unable to rename the new folder to the chrome version
@echo off
setlocal EnableExtensions DisableDelayedExpansion
rem Ensure the Temp directory exists
if not exist “C:Temp” mkdir “C:Temp”
rem Download the 32-bit version of Google Chrome
curl -o “C:Tempgooglechromestandaloneenterprise.msi” “https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B03FE9563-80F9-119F-DA3D-72FBBB94BC26%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable%26brand=GCEA/dl/chrome/install/googlechromestandaloneenterprise.msi”
rem Download the 64-bit version of Google Chrome
curl -o “C:Tempgooglechromestandaloneenterprise64.msi” “https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B03FE9563-80F9-119F-DA3D-72FBBB94BC26%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable%26brand=GCEA/dl/chrome/install/googlechromestandaloneenterprise64.msi”
rem Extract version number from the 32-bit installer
for /F “tokens=2 delims==” %%G in (‘%SystemRoot%System32wbemwmic.exe DATAFILE where “Name=C:Tempgooglechromestandaloneenterprise.msi'” GET Version /VALUE’) do for /F “delims=” %%H in (“%%G”) do set “version=%%H”
rem Create a new folder with the version number
mkdir “C:Temp%version%”
rem Move the downloaded files to the version folder
move /Y “C:Tempgooglechromestandaloneenterprise*.msi” “C:Temp%version%” >nul
rem Notify the user that the download is complete
echo Download complete: C:Temp%version%googlechromestandaloneenterprise.msi and C:Temp%version%googlechromestandaloneenterprise64.msi
pause
CMD command, unable to create new folder
file download successfully
Expected results
- The command should download file,
- create new folder
- rename the folder with the chrome version
- Move the downloaded file[Chrome] to the folder (eg. folder name is 125.0.6422.142)
- I will run a schedule task and let is Run weekly as i will be on leave for few months.
Mohd Nor Amin Bin Kasmuri is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.