Google Chrome silent uninstall

This will:
  • use native windows tools to detect application
  • uninstall 64-bit version on 64-bit windows
  • uninstall 32-bit version on 64-bit windows
  • uninstall 32-bit version on 32-bit windows

This is tested together with Google Chrome msi installers like:
GoogleChromeStandaloneEnterprise64.msi
GoogleChromeStandaloneEnterprise.msi

silent-uninstall.cmd
@echo off
set sw=HKLM\SOFTWARE
set u=Microsoft\Windows\CurrentVersion\Uninstall
set n=Google Chrome
setlocal EnableDelayedExpansion
if "%ProgramFiles(x86)%"=="" goto native

:only64bit
for /f "tokens=8 delims=\" %%a in ('^
reg query "%sw%\Wow6432Node\%u%" /s ^| find "\Uninstall\"') do (
reg query "%sw%\Wow6432Node\%u%\%%a" /v DisplayName > nul 2>&1
if !errorlevel!==0 (
reg query "%sw%\Wow6432Node\%u%\%%a" /v DisplayName | find "%n%" > nul 2>&1
if !errorlevel!==0 (
echo %%a | find "{"
if !errorlevel!==0 %systemroot%\system32\msiexec.exe /X %%a /qn
)
)
)

:native
for /f "tokens=7 delims=\" %%a in ('^
reg query "%sw%\%u%" /s ^| find "\Uninstall\"') do (
reg query "%sw%\%u%\%%a" /v DisplayName > nul 2>&1
if !errorlevel!==0 (
reg query "%sw%\%u%\%%a" /v DisplayName | find "%n%" > nul 2>&1
if !errorlevel!==0 (
echo %%a | find "{"
if !errorlevel!==0 %systemroot%\system32\msiexec.exe /X %%a /qn
)
)
)

endlocal
Check out more from