Posted by TMBEDV
Henagon

Uninstallation of Teamviewer not possible

Hello,

 

i´ve tried to uninstall TV14 which was rolled out via msi (script). There was a previous tv-installation (i guess 13) which is causing trouble.

I´m currently unable to uninstall tv via Uninstall/Programs or via msiexec shell. I´m getting error 1603 in uninstallation. When i use graphic interface via Software Teamviewer 14 is listed but cannot be uninstalled (uninstallation is immediately rolled back).

I´ve also tried to delete the software manually - without luck. I´ve deleted the necessary strings in the registry.

What to do?

Kind regards,

Simon-Timothy

4 Replies
4 Replies
Posted by FriendlyGuy
Electron

Re: Uninstallation of Teamviewer not possible

Same issues. Bump

Posted by FriendlyGuy
Electron

Re: Uninstallation of Teamviewer not possible

Posted by RCT_IT
Trigon

Re: Uninstallation of Teamviewer not possible

Hey Mate,

Try this:

::::::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights V2
::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================

:init
setlocal DisableDelayedExpansion
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion

:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************

ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
ECHO args = args ^& strArg ^& " " >> "%vbsGetPrivileges%"
ECHO Next >> "%vbsGetPrivileges%"
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
"%SystemRoot%\System32\WScript.exe" "%vbsGetPrivileges%" %*
exit /B

:gotPrivileges
setlocal & pushd .
cd /d %~dp0
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul & shift /1)

::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::
REM Run shell as admin (example) - put here code as you like
ECHO %batchName% Arguments: %1 %2 %3 %4 %5 %6 %7 %8 %9

:: TURN OFF IE SECURITY================================================================================================================
Echo Temporarily turning off the Security Check Settings
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /V "1806" /T "REG_DWORD" /D "00000000" /F
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /V "1806" /T "REG_DWORD" /D "00000000" /F
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Internet Explorer\Security" /V "DisableSecuritySettingsCheck" /T "REG_DWORD" /D "00000001" /F
:: TURN OFF IE SECURITY================================================================================================================

:: TURNING OFF UAC==========================================================================================================================
:: Start Turn off UAC
Echo Turn off UAC
:: Windows 7 UAC
%windir%\System32\reg.exe ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
:: Windows 10 UAC
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f
#net stop browser && net stop server && net start server && net start browser
:: TURNING OFF UAC==========================================================================================================================

MD C:\ITSupport\Logs
SET logfile="C:\ITSupport\Logs\TV__Admin_Uninstall.LOG"
ECHO Batch command: %0 %* >%logfile%
ECHO -------------------------------------- >> %logfile%
ECHO Started at %date% %time% >> %logfile%
ECHO -------------------------------------- >> %logfile%

Taskkill /T /F /IM TeamViewer.exe >> %logfile%
Taskkill /T /F /IM TeamViewer_Service.exe >> %logfile%
Taskkill /T /F /IM tv_w32.exe >> %logfile%
Taskkill /T /F /IM tv_x64.exe >> %logfile%

@echo off
SET Version=Unknown

wmic os get osarchitecture | FINDSTR /IL "32" > NUL
IF %ERRORLEVEL% EQU 0 SET Version="32"

wmic os get osarchitecture | FINDSTR /IL "64" > NUL
IF %ERRORLEVEL% EQU 0 SET Version="64"

ECHO The OS architecture of Windows found is %VERSION% bit

IF %VERSION% == "32" GOTO UNINSTALL_OLD_TV_EXE_OFF_32_ARCH
IF %VERSION% == "64" GOTO UNINSTALL_OLD_TV_EXE_OFF_64_ARCH
::If no versions are found go to UNKNOWN
GOTO UNKNOWN

:UNINSTALL_OLD_TV_EXE_OFF_32_ARCH
IF EXIST "C:\Program Files\TeamViewer" (ECHO TV x32 is installed & GOTO :TV_x32_EXE) ELSE (ECHO TV EXE is not installed & GOTO :UNINSTALL_OLD_TV_MSI)

:TV_x32_EXE
START /WAIT "Uninstalling x32 TV" "C:\Program Files\TeamViewer\uninstall.exe" /S
RD /S /Q "C:\Program Files\Teamviewer" >> %logfile%
RD /S /Q %APPDATA%\TEAMVIEWER >> %logfile%
RD /S /Q %TEMP%\TEAMVIEWER >> %logfile%
DEL /s /q /f "%PUBLIC%\Desktop\*TeamViewer*.lnk" >> %logfile%
DEL /s /q /f "%USERPROFILE%\*TeamViewer*.lnk" >> %logfile%
GOTO UNINSTALL_OLD_TV_MSI

:UNINSTALL_OLD_TV_EXE_OFF_64_ARCH
IF EXIST "C:\Program Files (x86)\TeamViewer" (ECHO TV x32 is installed & GOTO :TV_x64_EXE) ELSE (ECHO TV EXE is not installed & GOTO :UNINSTALL_OLD_TV_MSI)

:TV_x64_EXE
START /WAIT "Uninstalling x32 TV" "C:\Program Files (x86)\TeamViewer\uninstall.exe" /S
RD /S /Q "C:\Program Files (x86)\TeamViewer" >> %logfile%
RD /S /Q %APPDATA%\TEAMVIEWER >> %logfile%
RD /S /Q %TEMP%\TEAMVIEWER >> %logfile%
DEL /s /q /f "%PUBLIC%\Desktop\*TeamViewer*.lnk" >> %logfile%
DEL /s /q /f "%USERPROFILE%\*TeamViewer*.lnk" >> %logfile%
GOTO UNINSTALL_OLD_TV_MSI

:UNKNOWN
ECHO OS Architecture Unknown

:UNINSTALL_OLD_TV_MSI
PowerShell.exe -ExecutionPolicy Bypass -File "Uninstall_TV.ps1" -WindowStyle Hidden

:: TURN ON IE SECURITY======================================================================================================
:TURN ON IE SECURITY
Echo Turning on Security Check Settings
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /V "1806" /T "REG_DWORD" /D "00000001" /F
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3" /V "1806" /T "REG_DWORD" /D "00000001" /F
REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Internet Explorer\Security" /V "DisableSecuritySettingsCheck" /F
:: TURN ON IE SECURITY======================================================================================================

:END
CALL TV_Host_EXE.bat

This section Below put into Notepad and call Uninstall_TV.ps1

$uninstall32 = gci "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "TeamViewer" } | select UninstallString
$uninstall64 = gci "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "TeamViewer" } | select UninstallString

if ($uninstall64) {
$uninstall64 = $uninstall64.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall64 = $uninstall64.Trim()
Write "Uninstalling..."
start-process "msiexec.exe" -arg "/X $uninstall64 /qn" -Wait}
if ($uninstall32) {
$uninstall32 = $uninstall32.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall32 = $uninstall32.Trim()
Write "Uninstalling..."
start-process "msiexec.exe" -arg "/X $uninstall32 /qn" -Wait}

Posted by RCT_IT
Trigon

Re: Uninstallation of Teamviewer not possible

If that still doesn't work, then run this PowerShell Code to remove TV from Control Panel:

#Removes TV from Control Panel

$RE = 'TeamViewer*'
$Key = 'HKLM:\SOFTWARE\Classes\Installer\Products'
Get-ChildItem $Key -Rec -EA SilentlyContinue | ForEach-Object {
$CurrentKey = (Get-ItemProperty -Path $_.PsPath)
If ($CurrentKey -match $RE){
$CurrentKey|Remove-Item -Force -Recurse -Confirm:$false | Out-Null
}
}