Skip to content

Instantly share code, notes, and snippets.

@absynce
Created May 19, 2015 21:06
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save absynce/7667bd32e632e72f406f to your computer and use it in GitHub Desktop.
Save absynce/7667bd32e632e72f406f to your computer and use it in GitHub Desktop.
Enable or disable Chrome updates in Windows via the registry - replaces https://gist.github.com/absynce/c35b93e27ababbeb9063
# *******************************************
#
# Mod by: Jared M. Smith
# Mod on: 2015.04.xx
# Mod y?: Enable or disable Google Chrome updates.
#
# *******************************************
# Log method
if (! (test-path function:Log)) { function Log { Param([string]$message) Write-Host $message; } }
function SetChromeUpdates
{
Param(
[Parameter(Position=0, Mandatory=1)]
[boolean]$allowChromeUpdates=$true
)
$updateText = "Enabling"
# Enable/disable Chrome updates integer value
$allowChromeUpdatesValue = [int]$allowChromeUpdates
$notAllowChromeUpdatesValue = [int]!$allowChromeUpdates #inverted value
if (!$allowChromeUpdates) {
$updateText = "Disabling"
}
Log "$updateText Google Chrome updates."
New-Item -Path HKLM:\SOFTWARE\Policies\Google -name Update -value $allowChromeUpdatesValue -Force
New-Item -Path HKLM:\SOFTWARE\Wow6432Node\Policies\Google -name Update -value $allowChromeUpdatesValue -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Google\Update -type dword -name AutoUpdateCheckPeriodMinutes -value $allowChromeUpdatesValue -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Google\Update -type dword -name DisableAutoUpdateChecksCheckboxValue -value $notAllowChromeUpdatesValue -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Google\Update -type dword -name "Update{8A69D345-D564-463C-AFF1-A69D9E530F96}" -value $allowChromeUpdatesValue -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Google\Update -type dword -name UpdateDefault -value $allowChromeUpdatesValue -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Policies\Google\Update -type dword -name AutoUpdateCheckPeriodMinutes -value $allowChromeUpdatesValue -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Policies\Google\Update -type dword -name DisableAutoUpdateChecksCheckboxValue -value $notAllowChromeUpdatesValue -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Policies\Google\Update -type dword -name "Update{8A69D345-D564-463C-AFF1-A69D9E530F96}" -value $allowChromeUpdatesValue -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Policies\Google\Update -type dword -name UpdateDefault -value $allowChromeUpdatesValue -Force
Log "Added registry keys for $updateText Google updates."
if ($allowChromeUpdates) {
Start-Service gupdate
Start-Service gupdatem
Log "Attempted to start Google update services(s)."
}
else {
Stop-Service gupdate
Stop-Service gupdatem
Log "Stopped Google update services(s)."
}
}
@Stephan972
Copy link

Stephan972 commented Jul 25, 2017

The value 8A69D345-D564-463C-AFF1-A69D9E530F96 should not be hard coded in the script. It may change from update to update.
Check the directory C:\Program Files (x86)\Google\Update\Download for finding the appropriate values to look for in registry.

I assume Chrome is installed in C:\Program Files (x86)\Google\

@vorticus
Copy link

where do i put it and how do i install it?

@vorticus
Copy link

AWESOME scirpt by the way, love it, havent tried it out, but i hope to get reply soon, even nearly 3 years later i still hope this works :D

@TheNathanRandall
Copy link

A suggestion:
AutoUpdateCheckPeriodMinutes is being set to 1 when enabling. That causes Updater to check for updates every minute. It may be better to include a larger number there. Google's default is 1400, which works out to 23 hours 20 minutes.

Otherwise:
Great script!

@absynce
Copy link
Author

absynce commented Jul 28, 2020

Thanks @Sysiphean! Good point. I don't use this anymore, but I hope it helps other folks who might find this.

@asmirbelkic
Copy link

this is not working anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment