使用 PowerShell 禁用更新
打开 PowerShell 直接复制以下脚本运行一下更加方便:
if ([Environment]::Is64BitOperatingSystem -eq "True") {
#Write-Host "64-bit OS"
$PF=${env:ProgramFiles(x86)}
}
else {
#Write-Host "32-bit OS"
$PF=$env:ProgramFiles
}
if ($(Test-Path "$env:ProgramFiles\Google\Chrome\Application\chrome.exe") -eq "true") {
# 结束进程
taskkill /im chrome.exe /f
taskkill /im GoogleUpdate.exe /f
# Google Chrome 更新服务
#这里也可以使用 sc.exe stop "service name"
Stop-Service -Name "gupdate"
Stop-Service -Name "gupdatem"
Stop-Service -Name "GoogleChromeElevationService"
# Windows 10 默认 PS 版本 5.1 没有 Remove-Service 命令
# This cmdlet was added in PS v6. See https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6#cmdlet-updates.
#Remove-Service -Name "gupdate"
#Remove-Service -Name "gupdatem"
#Remove-Service -Name "GoogleChromeElevationService"
# sc 在 PowerShell 中是 Set-Content 别名,所以要使用 sc.exe 否则执行后无任何效果
sc.exe delete "gupdate"
sc.exe delete "gupdatem"
sc.exe delete "GoogleChromeElevationService"
# 任务计划企业版
schtasks.exe /Delete /TN \GoogleUpdateBrowserReplacementTask /F
schtasks.exe /Delete /TN \GoogleUpdateTaskMachineCore /F
schtasks.exe /Delete /TN \GoogleUpdateTaskMachineUA /F
# 移除更新程序
Remove-Item "$PF\Google\Update\" -Recurse -Force
echo "Disable Google Chrome Enterprise x64 Auto Update Successful!"
}
elseif ($(Test-Path "${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe") -eq "true") {
# 结束进程
taskkill /im chrome.exe /f
taskkill /im GoogleUpdate.exe /f
# Google Chrome 更新服务
#这里也可以使用 sc.exe stop "service name"
Stop-Service -Name "gupdate"
Stop-Service -Name "gupdatem"
Stop-Service -Name "GoogleChromeElevationService"
# Windows 10 默认 PS 版本 5.1 没有 Remove-Service 命令
# This cmdlet was added in PS v6. See https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6#cmdlet-updates.
#Remove-Service -Name "gupdate"
#Remove-Service -Name "gupdatem"
#Remove-Service -Name "GoogleChromeElevationService"
# sc 在 PowerShell 中是 Set-Content 别名,所以要使用 sc.exe 否则执行后无任何效果
sc.exe delete "gupdate"
sc.exe delete "gupdatem"
sc.exe delete "GoogleChromeElevationService"
# 任务计划企业版
schtasks.exe /Delete /TN \GoogleUpdateBrowserReplacementTask /F
schtasks.exe /Delete /TN \GoogleUpdateTaskMachineCore /F
schtasks.exe /Delete /TN \GoogleUpdateTaskMachineUA /F
# 移除更新程序
Remove-Item "$PF\Google\Update\" -Recurse -Force
echo "Disable Google Chrome Enterprise x86 Auto Update Successful!"
}
else {
echo "No Google Chrome Enterprise Installation Detected!"
}
评论区