Technical method to disable automatic updates in Chrome

Technical method to disable automatic updates in Chrome

introduce

For some users, the automatic update feature of Chrome browser may cause some inconvenience or unnecessary trouble. This article will describe how to use a batch script to stop and disable Chrome's automatic updates to ensure that background network operations are no longer performed. The article will detail the steps for writing and executing the code.

Preparation

Before you begin, make sure you have installed the Chrome browser and have administrator rights.

Script

  1. Open a text editor (such as Notepad).

  2. Copy and paste the provided code into a text editor.

    @echo off
    chcp 65001 > nul
    
    REM 停止并禁用 gupdate 服务
    echo 正在停止和禁用 gupdate 服务...
    sc stop gupdate
    sc config gupdate start= disabled
    echo gupdate 服务已成功停止和禁用。
    
    REM 停止并禁用 gupdatem 服务
    echo 正在停止和禁用 gupdatem 服务...
    sc stop gupdatem
    sc config gupdatem start= disabled
    echo gupdatem 服务已成功停止和禁用。
    
    REM 删除 Chrome 的 Update 文件夹及其内容
    set "chrome_dir=C:\Program Files (x86)\Google\Update"
    
    REM 尝试结束 Chrome 进程以便删除文件
    echo 正在结束 Chrome 进程以便删除文件...
    taskkill /F /IM chrome.exe /T
    echo Chrome 进程已成功终止。
    
    REM 等待一段时间以确保进程被终止
    echo 正在等待一段时间以确保进程被终止...
    ping 127.0.0.1 -n 5 > nul
    
    REM 检查 Chrome Update 文件夹是否存在
    echo 正在检查 Chrome Update 文件夹是否存在...
    if exist "%chrome_dir%" (
        REM 删除文件夹及其内容
        echo 正在删除 Chrome Update 文件夹及其内容...
        tasklist /FI "IMAGENAME eq chrome.exe" 2>NUL | find /I /N "chrome.exe">NUL
        if "%ERRORLEVEL%"=="0" (
            echo 关闭 Chrome 进程...
            taskkill /F /IM chrome.exe /T
        )
        echo 等待一段时间以确保进程被终止...
        ping 127.0.0.1 -n 5 > nul
        rmdir /Q /S "%chrome_dir%"
        
        REM 设置 Update 文件夹权限为拒绝对 SYSTEM 用户的完全控制
        echo 正在设置 Chrome Update 文件夹权限...
        icacls "%chrome_dir%" /deny SYSTEM:(F)
        echo 更新服务已成功关闭并禁用,Chrome Update 文件夹已删除,权限已修改。
    ) else (
        echo Chrome Update 文件夹不存在,无需删除。
    )
    
    pause
    
    
  3. Save the file as disable_chrome_update.bat, making sure the file extension is .bat.

run script

  1. Navigate to the folder where the script is saved.

  2. Right-click disable_chrome_update.batthe file and select "Run as administrator."

    Insert image description here

Script function analysis

  1. Stop and disable services: Stop and disable Chrome's services gupdateby executing the command sc stop gupdateand .sc config gupdate start= disabledgupdate

  2. Stop and disable services: Stop and disable Chrome's services gupdatemby executing the command sc stop gupdatemand .sc config gupdatem start= disabledgupdatem

  3. Delete Chrome's Updatefolder and its contents: By setting the variable chrome_dirto Chrome's installation path, and then using the command rmdir /Q /S "%chrome_dir%"to delete the entire folder and its contents. If the deletion is unsuccessful, use the command icacls "%chrome_dir%" /deny SYSTEM:(F)to deny the SYSTEM user full control of the folder.

Precautions

  • Please proceed with caution and ensure that important data and systems are backed up.
  • After disabling automatic updates, you will need to manually check for updates regularly and perform updates to ensure you have the latest version of security and functionality patches.

The above are the detailed steps of the technical method to disable automatic updates in Chrome. By writing batch scripts, you can easily stop and disable Chrome's automatic updates, and modify Chrome shortcuts accordingly. Hope this article helps you!

Guess you like

Origin blog.csdn.net/m0_67268191/article/details/133394619