标题: Google Chrome完美安装批处理最终版 [打印本页] 作者: 深谷憂狼 时间: 3 天前 标题: Google Chrome完美安装批处理最终版 本帖最后由 深谷憂狼 于 2026-2-21 14:05 编辑
超高速下载,超快部署安装,完美关联各文件,完美打开QQ聊天记录的网址,完美真打开.url
@echo off
if /i "%UserName%" == "SYSTEM" (Goto GotAdmin) else (reg query "HKLM\SYSTEM\ControlSet001\Control\MiniNT" 1>nul 2>nul&&Goto GotAdmin)
:BatchGotAdmin
net session >nul 2>&1||(echo Set objShell=CreateObject^("Shell.Application"^) > "%temp%\uac.vbs"&echo objShell.ShellExecute "cmd.exe","/c ""%~f0"" %*","","runas",1 >> "%temp%\uac.vbs"&cscript //nologo "%temp%\uac.vbs"&del /f /q "%temp%\uac.vbs"&exit /b)
:GotAdmin
Pushd "%CD%"&cd /d "%~dp0"
setlocal enabledelayedexpansion
Title Google Chrome快速安装&(if exist %WinDir%\System32\ureg.dll Mode 45,05 2>nul)&Color 03
for /f %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
for /f "delims=" %%f in ('dir /s /b "%SystemDrive%\chrome.exe" 2^>nul') do (start "" "%%~f"& exit /b)
set "ChromeAppDir=%ProgramFiles%\Google\Chrome\Application"
set "chromeExe=%ProgramFiles%\Google\Chrome\Application\chrome.exe"
set "aria2c="
for %%d in (%SystemDrive:~0,1% C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist "%%d:\" for /f "delims=" %%f in ('dir /s/b/a-d "%%d:\aria2c.exe" 2^>nul ^| find /v /i "\$Recycle.Bin\"') do set "aria2c=%%f" >nul 2>&1&goto found aria2c
:found aria2c
set "7z="
for %%d in (%SystemDrive:~0,1% C D E F G H I J K L M N O P Q R S T U V W X Y Z)do if exist "%%d:\" for /f "delims=" %%f in ('dir /s/b/a-d "%%d:\7z.exe" 2^>nul^|find /v /i "\$Recycle.Bin\"')do if exist "%%~dpf7z.dll" if exist "%%~dpf7zG.exe" (set "7z=%%f"&goto found 7Z)
:found 7Z
if not defined 7z goto OLD
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion|findstr "6.1">nul&&goto OLD
if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" (Set bit=64) else Set bit=
set "ChromeUrl=https://dl.google.com/tag/s/installdataindex/update2/installers/ChromeStandaloneSetup%bit%.exe"
Set "ChromeSetup=ChromeStandaloneSetup%bit%.exe"
echo %esc%[94m正在高速下载……%esc%[0m
if not exist "!ChromeSetup!" (aria2c -h >nul 2>&1&&aria2c -x16 -s16 -k2M --file-allocation=none --console-log-level=notice --check-certificate=false --follow-torrent=false -o "!ChromeSetup!" "!ChromeUrl!"||curl -V >nul 2>&1&&curl "!ChromeUrl!" -L -o "!ChromeSetup!" -# --connect-timeout 5 --max-time 60 -k||(echo %esc%[91m下载失败%esc%[0m&timeout /t 3 /nobreak >nul&exit /b))
echo %esc%[94m快速部署安装……%esc%[0m
:UNZIP
"!7z!" x "%ChromeSetup%" -o"%~dp0" -y -aoa -bd -mm=ultra-fast -mx0 >>nul
"!7z!" x "%~dp0updater.7z" -o"%~dp0" -y -aoa -bd -mm=ultra-fast -mx0 >>nul
for /f "delims=" %%i in ('dir /s /b "%~dp0bin\*chrome*.exe"') do ("!7z!" x "%%i" -o"%~dp0" -y -aoa -bd -mm=ultra-fast -mx0 >>nul
"!7z!" x "%~dp0chrome.7z" -o"%~dp0" -y -aoa -bd -mm=ultra-fast -mx0 >>nul
echo d|xcopy "%~dp0Chrome-bin" "!ChromeAppDir!" /E /Q /H /R /Y >nul 2>&1
)
for %%i in (bin Chrome-bin chrome.7z ChromeStandaloneSetup64.exe updater.7z) do (
if exist "%~dp0%%i\" rd /s /q "%~dp0%%i" >nul 2>&1
if exist "%~dp0%%i" del /f /q /a "%~dp0%%i" >nul 2>&1
)
Goto Setting
:OLD
if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
Set "bit=nvwf3mhcdg76ot6qwp75ovmh2u"
) else (
Set "bit=p5iizujxrjjggjfl7d4kvj5e5i"
)
set "URL=https://dl.google.com/release2/chrome/%bit%_109.0.5414.168/109.0.5414.168_chrome_installer.exe"
set "ChromeSetupold=chrome_installer.exe"
if not exist "!ChromeSetupold!" (!aria2c! -x16 -s16 -k2M --file-allocation=none --console-log-level=notice --check-certificate=false --follow-torrent=false -o "!ChromeSetupold!" "!Url!"||curl -V >nul 2>&1&&curl "!Url!" -L -o "!ChromeSetupold!" -s -k||(echo %esc%[91m下载失败%esc%[0m&timeout /t 3 /nobreak >nul&exit /b))
start /wait "" "!ChromeSetupold!" /silent /install /system-level >nul 2>&1
del /f /q "!ChromeSetupold!" >nul 2>&1
:Setting
if exist "!chromeExe!" (echo %esc%[92m安装成功,进行配置及关联%esc%[0m)
if not exist "!chromeExe!" (echo %esc%[91m安装失败%esc%[0m&&timeout /t 3 /nobreak >nul&exit /b)
taskkill /f /im "google*.exe" >nul 2>&1
timeout /t 1 /nobreak >nul
rd /s /q "!ChromeAppDir!\SetupMetrics" >nul 2>&1
rd /s /q "%ProgramFiles(x86)%\Google" >nul 2>&1
for /d %%v in ("%ChromeAppDir%\*.*") do (
if exist "%%v\locales\" (
for %%f in ("%%v\locales\*.pak") do (
if /i not "%%~nf"=="zh-CN" if /i not "%%~nf"=="en-US" (
del /f /q "%%f" >nul 2>&1
)
)
)
)
del /f /q "%USERPROFILE%\Desktop\*Google*.lnk" "%USERPROFILE%\Desktop\*Chrome*.lnk" "%PUBLIC%\Desktop\*Google*.lnk" "%PUBLIC%\Desktop\*Chrome*.lnk" "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Google*.lnk" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Google*.lnk" >nul 2>&1
rd /s /q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Google Chrome" >nul 2>&1
md "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Google" >nul 2>&1
set "LnkName=Google Chrome"
set "ChromeParams=--profile-directory=Default https://www.baidu.com"
set "LnkDesc=网页浏览器"
set "PubDesktop=%PUBLIC%\Desktop\!LnkName!"
set "PubProgram=%ProgramData%\Microsoft\Windows\Start Menu\Programs\Google\!LnkName!"
md "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Google" >nul 2>&1
call :CreateLnk "!PubDesktop!.lnk" "!chromeExe!" "!ChromeParams!" "!chromeExe!" "0" "!LnkDesc!" "!ChromeAppDir!" "3"
call :CreateLnk "!PubProgram!.lnk" "!chromeExe!" "!ChromeParams!" "!chromeExe!" "0" "!LnkDesc!" "!ChromeAppDir!" "3"