SimpleHelp Community

Uninstall Teamviewer and Andesk Script


#1

Hello
is there anytool uninstall anydesk or teamviwer script for all version ?


#2

I always find it very hard to use the built-in uninstall because you need to know the program’s ID. Maybe if there’s an executable for a removal tool you can run it using msiexec. I’ll have a look


#3

I use powershell to find and uninstall programs. This method you dont need to know the full name or the id.

$MyApp = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq “Free Tools”}
$MyApp.Uninstall()

for appx packages do this. This example removes appx version of skype for all users:

#Remove-AppxPackage -Package “Microsoft.SkypeApp_15.63.76.0_x86__kzf8qxf38zg5c” -AllUsers
Get-AppxProvisionedPackage -Online | where {$_.PackageName -like “Skype”} | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue

$result = Get-AppXPackage Microsoft.SkypeApp* -AllUsers
if ($result -eq $null) {write-host “Program uninstalled”} else {write-host “There are some issues” + " " + $result}


#4

Get-VmiObject -class win32_Product dosent list anydesk application and win7 dosent support appxpackage .
i get it uninstall string for anydesk but it dosent work it

$SEARCH = ‘Anydesk’
$RESULT =$INSTALLED | ?{ $.DisplayName -ne $null } | Where-Object {$.DisplayName -match $search }
$RESULT
if ($RESULT.uninstallstring -like “msiexec*”) {
$ARGS=(($RESULT.UninstallString -split ’ ‘)[1] -replace ‘/I’,’/X ‘) + ’ /q’
Start-Process msiexec.exe -ArgumentList $ARGS -Wait
} else {
Start-Process $RESULT.UninstallString -Wait
}


#5

How can this be used in, say, a simplehelp tool that asks me which package to uninstall (or that I can put the text in) and uninstall it?
Thanks
Anthony


#6

I’m not really good with powershell, but anyone’s welcome to clean it up. This uses SimpleHelp’s Scripting API (https://simple-help.com/toolbox-guide#Scripting-API-Functions). The script will prompt the technician for the name of the software to remove. We then pass it as a variable and try to locate the software to uninstall. I have not tested to see what happens if multiple packages are found. I would assume there would need to be a while loop or something to address multiple packages. I did test this against a workstation to remove Silverlight and it worked without a hitch. Hope this helps!

ServerUtilsAskTech(Software Removal,title)
ServerUtilsAskTech(Accept,submit)
$AppName=‘ServerUtilsAskTech(Application Name,text,enter name of software to remove,required)’

$MyApp = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -Like “*$AppName*”}

if ($MyApp -eq $null){Write-Host “$AppName could not be found…Bye”} Else{$MyApp.Uninstall()}


#7

I just found out the hard way that you need to convert the " and ’ to standard quotes and apostrophes rather than the open and close ones that are in Ted’s post :slight_smile:


#8

I think the forum software is messing up the code. I think I needed to quote it code style… My Bad.

ServerUtilsAskTech(Software Removal,title)
ServerUtilsAskTech(Accept,submit)
$AppName='ServerUtilsAskTech(Application Name,text,enter name of software to remove,required)'

$MyApp = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -Like "*$AppName*"}

if ($MyApp -eq $null){Write-Host "$AppName could not be found...Bye"} Else{$MyApp.Uninstall()}

Maybe that will help???

NOTE: NEVER COPY & PATE CODE DIRECTLY INTO PRODUCTION SYSTEMS!!! ALWAYS SANITIZE IT IN A PLAIN TEXT EDITOR LIKE BBEDIT/NOTEPAD++

You running this script/function means you will not blame the author(s) if this breaks your stuff. This script/function is provided AS IS without warranty of any kind. Author(s) disclaim all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall author(s) be held liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the script or documentation. Neither this script/function, nor any part of it other than those parts that are explicitly copied from others, may be republished without author(s) express written permission. Author(s) retain the right to alter this disclaimer at any time.


#9

I still can’t get it to work. Perhaps the test software I’m using is an interactive uninstall (It’s libreoffice).


#10

if you run the command from the console on the machine does it return multiple applications by chance?

Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -Like “*libreoffice*”}

#11

Ah… actually it did work. I think the last time it didn’t work because the PC rebooted itself unexpectedly (probably an update). I ran it again and it worked. See screenshot below.

Thanks for posting that. It will prove useful. Only problem is that if you select multiple machines, you can’t get it to ask you just once for which software to remove.


#12

No, I’m wrong again… it doesn’t ask you for each machine. I think I need another nap…

Do you know what happens if it is an interactive uninstaller? I run these tools as the ‘service user’


#13

gots no clue… probably show the uninstaller window. If you need to submit commands then you would probably not want to use this method you would probably want to use a different uninstall method.


#14

Not sure if there is a command line for this, but I like to use Geek Uninstaller (https://geekuninstaller.com/) when I need to do any kind of forceful remove, it also does a cleanup of registry entries and orphaned files.