无忧启动论坛

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

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

    [复制链接]
跳转到指定楼层
1#
本帖最后由 深谷憂狼 于 2026-2-27 17:19 编辑

超高速下载,超快部署安装,完美关联各文件,完美打开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 %%p in ("%ProgramFiles%\Google\Chrome\Application\chrome.exe" "%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe") do if exist "%%~p" (start "" "%%~p" --profile-directory=Default https://www.baidu.com& exit /b)
set "ChromeAppDir=%ProgramFiles%\Google\Chrome\Application"
set "chromeExe=%ProgramFiles%\Google\Chrome\Application\chrome.exe"
set "aria2c_Args=-s16 -x16 -k2M --file-allocation=none --console-log-level=warn  --download-result=hide --check-certificate=false --follow-torrent=false  --http-no-cache -U "Mozilla/5.0" -c --disable-ipv6"
Set "CUrl_Args=-# --connect-timeout 5 --max-time 60 -k"
set "DIR=%Temp%"
set "7z="
(7z.exe >nul 2>&1 && set "7z=7z.exe") || (
    set "d=%~dp07-Zip"
    if exist "!d!\" if exist "!d!\7z.exe" if exist "!d!\7z.dll" set "7z=!d!\7z.exe"
)
if not defined 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 %%p in ("Program Files\7-Zip" "Program Files (x86)\7-Zip") do (
                set "d=%%d:\%%~p"
                if exist "!d!\7z.exe" if exist "!d!\7z.dll" set "7z=!d!\7z.exe" & goto f
            )
        )
    )
)
:f
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%[93m正在高速下载……%esc%[0m
if exist "%DIR%\%ChromeSetup%.aria2" del /f /q "%DIR%\%ChromeSetup%*" >nul 2>&1
if not exist "%DIR%\%ChromeSetup%" (aria2c -h 1>nul 2>nul&&aria2c %aria2c_Args% -d"%DIR%" -o "%ChromeSetup%" "%ChromeUrl%"||curl -V >nul 2>&1&&curl "%ChromeUrl%" -L -o "%DIR%\%ChromeSetup%" %CUrl_Args%||(echo  %esc%[91m下载失败, 3秒后退出批处理%esc%[0m&timeout /t 3 /nobreak >nul&exit /b))
echo %esc%[94m快速部署安装……%esc%[0m

:UNZIP
"!7z!" x "%DIR%\%ChromeSetup%" -o"%DIR%" -y -aoa -bd -mm=ultra-fast -mx0 >>nul
"!7z!" x "%DIR%\updater.7z" -o"%DIR%" -y -aoa -bd -mm=ultra-fast -mx0 >>nul
for /f "delims=" %%i in ('dir /s /b "%DIR%\bin\*chrome*.exe"') do ("!7z!" x "%%i" -o"%DIR%" -y -aoa -bd -mm=ultra-fast -mx0 >>nul
"!7z!" x "%DIR%\chrome.7z" -o"%DIR%" -y -aoa -bd -mm=ultra-fast -mx0 >>nul
echo d|xcopy "%DIR%\Chrome-bin" "!ChromeAppDir!" /E /Q /H /R /Y >nul 2>&1
)
for %%i in (bin Chrome-bin chrome.7z updater.7z %ChromeSetup%) do (
    if exist "%DIR%\%%i\" rd /s /q "%DIR%\%%i" >nul 2>&1
    if exist "%DIR%\%%i" del /f /q /a "%DIR%\%%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 "%DIR%\%ChromeSetupold%" ("%aria2c%" %aria2c_Args% -d"%DIR%" -o "%ChromeSetupold%" "%ChromeUrl%"||curl -V >nul 2>&1&&curl "%ChromeUrl%" -L -o "%DIR%\%ChromeSetupold%" %CUrl_Args%||(echo  %esc%[91m下载失败, 3秒后退出批处理%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 /? >nul 2>&1&&taskkill /f /im "google*.exe" >nul 2>&1
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 -h >nul 2>&1&&Shortcut "!PubDesktop!.lnk" "!chromeExe!" "!ChromeParams!" "!chromeExe!" "0" nor "" "!LnkDesc!"
        Shortcut -h >nul 2>&1&&Shortcut "!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 1>nul 2>nul&&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




点评

江南无所有,聊增一枝春  发表于 7 天前

评分

参与人数 2无忧币 +10 收起 理由
张小仙 + 5 赞一个!
浪仔 + 5 很给力!

查看全部评分

2#
发表于 7 天前 | 只看该作者
谢谢楼主分享
回复

使用道具 举报

3#
发表于 7 天前 | 只看该作者
完美批处理
回复

使用道具 举报

4#
发表于 7 天前 | 只看该作者
非常感谢!
回复

使用道具 举报

5#
发表于 7 天前 | 只看该作者
多谢楼主分享!!!
回复

使用道具 举报

6#
发表于 7 天前 | 只看该作者
谢谢楼主的分享。用这个做个在线安装程序可好?希望能够提供个,谢谢了。
回复

使用道具 举报

7#
发表于 7 天前 | 只看该作者
感谢分享!
回复

使用道具 举报

8#
发表于 7 天前 | 只看该作者
安装批处理
回复

使用道具 举报

9#
发表于 7 天前 | 只看该作者
谢谢分享
回复

使用道具 举报

10#
发表于 7 天前 | 只看该作者
多谢楼主分享!
回复

使用道具 举报

11#
发表于 7 天前 | 只看该作者
支持原创
回复

使用道具 举报

12#
发表于 7 天前 | 只看该作者
感谢大侠分享技术
回复

使用道具 举报

13#
发表于 7 天前 | 只看该作者
感谢分享
回复

使用道具 举报

14#
发表于 7 天前 | 只看该作者
无忧论坛,好东西就是多 thanks
回复

使用道具 举报

15#
发表于 7 天前 | 只看该作者
感谢分享
回复

使用道具 举报

16#
发表于 7 天前 | 只看该作者
感谢分享!
回复

使用道具 举报

17#
发表于 7 天前 | 只看该作者
留个脚印
回复

使用道具 举报

18#
发表于 7 天前 | 只看该作者
感谢分享
回复

使用道具 举报

19#
发表于 7 天前 | 只看该作者
感谢分享精彩
回复

使用道具 举报

20#
发表于 7 天前 | 只看该作者
好东西值得分享,感谢!
回复

使用道具 举报

21#
发表于 7 天前 | 只看该作者
好人啊,谢谢嗷!
回复

使用道具 举报

22#
发表于 7 天前 | 只看该作者
试过了,真的很完美!!
回复

使用道具 举报

23#
发表于 7 天前 | 只看该作者
难道 HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice下ProgId为ChromeHTML,hash值就是固定的 EDlOyJI4YAM=  ?
回复

使用道具 举报

24#
发表于 7 天前 | 只看该作者
感谢分享!
回复

使用道具 举报

25#
发表于 7 天前 | 只看该作者
感觉看不懂啊,是用来安装谷歌浏览器吗
回复

使用道具 举报

26#
发表于 7 天前 | 只看该作者
感谢分享!
回复

使用道具 举报

27#
发表于 6 天前 | 只看该作者
谢谢分享,辛苦啦!
回复

使用道具 举报

28#
发表于 6 天前 | 只看该作者
创建快捷方式不建议产生临时文件!可以参考一下:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=449702

点评

之前就是用那种方式,会黑框一闪而过,所以改了,临时文件删除了的,没关系  详情 回复 发表于 昨天 16:52
回复

使用道具 举报

29#
发表于 6 天前 | 只看该作者
感谢楼主分享
回复

使用道具 举报

30#
发表于 6 天前 | 只看该作者
感谢分享
回复

使用道具 举报

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

本版积分规则

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

闽公网安备 35020302032614号

GMT+8, 2026-2-28 00:50

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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