Google Chrome v48.0 Completely Silent Uninstall
-
OK got it "AppData\Local\Google\Chrome\Application\48.0.2564.109\Installer\setup.exe" --uninstall --multi-install --chrome --verbose-logging -force-uninstall - Lotus8 8 years ago
Answers (2)
Here on ITNinja
This one, scroll down a bit...
and this one... just try the command line without psexec
Cheers
Phil
Comments:
-
Thanks, but all of these still prompt for the uninstall - Lotus8 8 years ago
Hi Lotus8
I was looking for this solution a few months ago. I wrote this script which is an adapted version of the msiworld script Phil posted a link to. Apologies to anybody who reads this script and double face palms, but VBS is not my strong point, but it should not prompt for uninstall. You could add a wait for process ends or kill process before attempting the uninstall, all up to you -
on error resume next
Const HKEY_LOCAL_MACHINE = &H80000002
Set wshShell = WScript.CreateObject( "WScript.Shell" )
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer()
Set props = service.ExecQuery _
("select name, description from Win32_Process where name = 'chrome.exe'")
num = props.Count
If num > 0 Then
WScript.quit
Else
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
dim folder, MyProperties, arrMyProperties, Exe, Param, oReg, strKeyPath, strValueName
wshShell.RegDelete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe\installed"
'==============================================================
'To check whether the OS is 32 bit or 64 bit of Windows 7
'==============================================================
'Lines to detect whether the OS is 32 bit or 64 bit of Windows 7
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputerName & "\root\default:StdRegProv")
strKeyPath = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"
strValueName = "Identifier"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'==============================================================
'Checking Condition whether the build is 64bit or 32 bit
if (instr(strValue,"64")) then
folder = "C:\Program Files (x86)\Google\Chrome"
RegVal = ReadReg ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\UninstallString")
End If
if (instr(strValue,"x86")) then
folder = "C:\Program Files\Google\Chrome"
RegVal = ReadReg ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome\UninstallString")
End If
'==============================================================
MyProperties = RegVal
arrMyProperties = Split(MyProperties, "-")
Exe = arrMyProperties(0)
Param = "--uninstall --multi-install --chrome --system-level --force-uninstall"
'Uninstall Previous version Chrome
'==============================================================
wshShell.run Exe & Param, 1, True
'Delete leftover folder and files from Previous version Chrome
'==============================================================
dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FolderExists(folder & "\") Then
filesys.DeleteFolder folder
End If
Function ReadReg(RegPath)
Dim objRegistry, Key
Set objRegistry = CreateObject("Wscript.shell")
Key = objRegistry.RegRead(RegPath)
ReadReg = Key
End Function
wshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe\",""
wshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe\installed","0", "REG_SZ"
End If
Set WSHShell = Nothing
- Lee