无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 619|回复: 29

[原创] Google Chrome完美安装批处理最终版

  [复制链接]
发表于 昨天 13:49 | 显示全部楼层 |阅读模式
本帖最后由 深谷憂狼 于 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"

if not exist "!PubDesktop!.lnk"  (
        Shortcut.exe "!PubDesktop!.lnk" "!chromeExe!" "!ChromeParams!" "!chromeExe!" "0" nor "" "!LnkDesc!"
        Shortcut.exe "!PubProgram!.lnk" "!chromeExe!" "!ChromeParams!" "!chromeExe!" "0" nor "" "!LnkDesc!"
)
if not exist "!PubDesktop!.lnk" (
PECMD LINK !PubDesktop!,!chromeExe!,!ChromeParams!,!chromeExe!,!LnkDesc!
PECMD LINK !PubProgram!,!chromeExe!,!ChromeParams!,!chromeExe!,!LnkDesc!
)
if not exist "!PubDesktop!.lnk" (
     mklink "!PubDesktop!" "!chromeExe!" >nul 2>&1
     mklink "!PubProgram!" "!chromeExe!" >nul 2>&1
)
::echo d|xcopy "%PUBLIC%\Desktop\Google Chrome.lnk" "%systemdrive%\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\ImplicitAppShortcuts\5d696d521de238c3" /E /Q /H /R /Y >nul 2>&1
PECMD PINT !PubDesktop!.lnk , TaskBand
goto AssocChrome
:CreateLnk
(
echo Set Link=WScript.CreateObject^("WScript.Shell"^).CreateShortcut^("%~1"^)
echo Link.TargetPath="%~2"
echo Link.Arguments="%~3"
echo Link.IconLocation="%~4,%~5"
echo Link.Description="%~6"
echo Link.WorkingDirectory="%~7"
echo Link.WindowStyle="%~8"
echo Link.Save
)>"%TEMP%\WScript.vbs"
cscript //nologo "%TEMP%\WScript.vbs" >nul 2>&1
del /f /q "%TEMP%\WScript.vbs" >nul 2>&1
Exit /b
:AssocChrome
Pushd "%CD%"&cd /d "%~dp0"
reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /f /v "AudioSandboxEnabled" /t REG_DWORD /d "0" 1>nul 2>nul
reg add "HKLM\SOFTWARE\WOW6432Node\Policies\Google\Chrome" /f /v "AudioSandboxEnabled" /t REG_DWORD /d "0" 1>nul 2>nul
reg add "HKCU\Software\Google\Chrome\Welcome" /v "HasSeenWelcomePage" /t REG_DWORD /d 1 /f >nul 2>&1
reg add "HKLM\Software\Policies\Google\Chrome" /v "ShowWelcomePage" /t REG_DWORD /d 0 /f >nul 2>&1
reg add "HKLM\Software\Policies\Google\Update" /v "UpdateDefault" /t REG_DWORD /d 0 /f >nul 2>&1
reg add "HKLM\Software\Policies\Google\Update" /v "DisableAutoUpdateChecks" /t REG_DWORD /d 1 /f >nul 2>&1
reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /v "DisableUpdatePrompt" /t REG_DWORD /d 1 /f >nul 2>&1
reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /v "SuppressUnsupportedOSWarning" /t REG_DWORD /d 1 /f >nul 2>&1
reg add "HKLM\SOFTWARE\Policies\Google\Update" /v "AutoUpdateCheckPeriodMinutes" /t REG_DWORD /d 0 /f >nul 2>&1
reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /v "SuppressUpdateNotification" /t REG_DWORD /d 1 /f >nul 2>&1
reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /v "DisableUpdateAvailableNotifications" /t REG_DWORD /d 1 /f  >nul 2>&1
reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /v "UpdateDisabled" /t REG_DWORD /d 1 /f >nul 2>&1
reg add "HKLM\Software\Policies\Google\Chrome" /v "DefaultBrowserSettingEnabled" /t REG_DWORD /d 0 /f >nul 2>&1
reg add "HKCU\Software\Google\Chrome" /v "SuppressDefaultBrowserPrompt" /t REG_DWORD /d 1 /f >nul 2>&1
set "EXT_ASSOC=htm html shtml xhtml mht mhtml asp aspx php jsp css js json svg xml pdf"
set "PROTO_ASSOC=http https ftp mailto"
for %%i in (%EXT_ASSOC%) do (
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.%%i\OpenWithProgids" /f >nul 2>&1
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.%%i\UserChoice" /f >nul 2>&1
)
for %%p in (%PROTO_ASSOC%) do (
    reg delete "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\%%p\UserChoice" /f >nul 2>&1
)
for %%i in (%EXT_ASSOC%) do (
    assoc .%%i=ChromeHTML >nul 2>&1
)
for %%i in (%EXT_ASSOC%) do (
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.%%i\OpenWithProgids" /v ChromeHTML /t REG_SZ /d "" /f >nul 2>&1
)
ftype ChromeHTML="!ChromeExe!" --single-argument "%%1" >nul 2>&1
reg add "HKCR\ChromeHTML\shell\open\command" /ve /d "\"!chromeExe!\" -- \"%%1\"" /f >nul 2>&1
for %%p in (%PROTO_ASSOC%) do (
    ftype %%p="!ChromeExe!" --single-argument "%%1" >nul 2>&1
    reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\%%p\UserChoice" /f /v "ProgId" /t REG_SZ /d "ChromeHTML"
)
reg add "HKCR\.URL" /f /ve /t REG_SZ /d "Chrome HTML" >nul 2>&1
reg add "HKCR\.URL\OpenWithProgIds" /f /v "InternetShortcut" /t REG_SZ /d "" >nul 2>&1
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice" /f /v "Hash" /t REG_SZ /d "EDlOyJI4YAM="
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice" /f /v "Hash" /t REG_SZ /d "1zl86D0O28Q="
:RunGoogle Chrome
Set "Google Chrome=!PubDesktop!.lnk"
@start "" "%Google Chrome%"

endlocal & Exit /b



点评

江南无所有,聊增一枝春  发表于 昨天 18:41

评分

参与人数 1无忧币 +5 收起 理由
浪仔 + 5 很给力!

查看全部评分

发表于 昨天 14:16 | 显示全部楼层
谢谢楼主分享
回复

使用道具 举报

发表于 昨天 14:49 | 显示全部楼层
完美批处理
回复

使用道具 举报

发表于 昨天 15:07 | 显示全部楼层
非常感谢!
回复

使用道具 举报

发表于 昨天 15:14 | 显示全部楼层
多谢楼主分享!!!
回复

使用道具 举报

发表于 昨天 15:28 | 显示全部楼层
谢谢楼主的分享。用这个做个在线安装程序可好?希望能够提供个,谢谢了。
回复

使用道具 举报

发表于 昨天 15:50 | 显示全部楼层
感谢分享!
回复

使用道具 举报

发表于 昨天 16:12 | 显示全部楼层
安装批处理
回复

使用道具 举报

发表于 昨天 17:36 | 显示全部楼层
谢谢分享
回复

使用道具 举报

发表于 昨天 17:39 | 显示全部楼层
多谢楼主分享!
回复

使用道具 举报

发表于 昨天 17:41 | 显示全部楼层
支持原创
回复

使用道具 举报

发表于 昨天 17:56 | 显示全部楼层
感谢大侠分享技术
回复

使用道具 举报

发表于 昨天 18:02 | 显示全部楼层
感谢分享
回复

使用道具 举报

发表于 昨天 18:11 | 显示全部楼层
无忧论坛,好东西就是多 thanks
回复

使用道具 举报

发表于 昨天 19:14 | 显示全部楼层
感谢分享
回复

使用道具 举报

发表于 昨天 19:36 | 显示全部楼层
感谢分享!
回复

使用道具 举报

发表于 昨天 19:41 | 显示全部楼层
留个脚印
回复

使用道具 举报

发表于 昨天 19:48 | 显示全部楼层
感谢分享
回复

使用道具 举报

发表于 昨天 19:53 | 显示全部楼层
感谢分享精彩
回复

使用道具 举报

发表于 昨天 20:05 | 显示全部楼层
好东西值得分享,感谢!
回复

使用道具 举报

发表于 昨天 20:42 | 显示全部楼层
好人啊,谢谢嗷!
回复

使用道具 举报

发表于 昨天 20:42 | 显示全部楼层
试过了,真的很完美!!
回复

使用道具 举报

发表于 昨天 21:54 | 显示全部楼层
难道 HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice下ProgId为ChromeHTML,hash值就是固定的 EDlOyJI4YAM=  ?
回复

使用道具 举报

发表于 昨天 22:36 | 显示全部楼层
感谢分享!
回复

使用道具 举报

发表于 昨天 22:49 | 显示全部楼层
感觉看不懂啊,是用来安装谷歌浏览器吗
回复

使用道具 举报

发表于 昨天 23:49 | 显示全部楼层
感谢分享!
回复

使用道具 举报

发表于 6 小时前 | 显示全部楼层
谢谢分享,辛苦啦!
回复

使用道具 举报

发表于 6 小时前 | 显示全部楼层
创建快捷方式不建议产生临时文件!可以参考一下:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=449702
回复

使用道具 举报

发表于 19 分钟前 | 显示全部楼层
感谢楼主分享
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2026-2-22 07:07

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表