Silent uninstall of teamviewer in powershell won't work with silent arguments, does anybody know what i am doing wrong?

4.2k views Asked by At

I am using Powershell scripts to install and uninstall different programs trough RMM software. Usually those scripts run without a problem but i noticed for teamviewer it gets stuck. I tried the following uninstall commands locally and found out teamviewer gives a prompt even though the arguments in the command are for a silent uninstall.

Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList "/S" -PassThru

Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -Argument "/silent" -PassThru

Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList '/S','/v','/qn' -passthru

Does anybody know what i am doing wrong or what a workaround can be or a different solution? I found this solution: https://silentinstallhq.com/teamviewer-install-and-uninstall-powershell/ But that is not what i am looking for, i don't want to install a different program just to be able to uninstall TeamViewer silently.

1

There are 1 answers

0
John A On

I ran into this problem, too. Surprisingly, I never found it solved through google searches but I discovered the fix was quite easy, and it's specific to PowerShell.

net stop TeamViewer

c:\program files\TeamViewer\uninstall.exe `/S

Notes: I like the old CMD net stop command because TeamViewer would just restart if I use the PS stop-process -Name TeamViewer* command. Most importantly, in PowerShell, you need to escape the / switch with the PS escape character ` (top-left key, same key as ~). The S is also case sensitive. Must be uppercase.