How can i uninstall Whatsapp application on KACE silently?
We have decided to remove Whatapp from our company devices. Anyone has done this before using KACE?
Answers (3)
Never used Whatsapp but online there is a powershell script.
$var = '"%LocalAppData%\WhatsApp\Update.exe" --uninstall -s'
Start-Process -Verb RunAs cmd.exe -Args '/c', $var
If that doesn't work, locate what the update.exe file is and try to specify that path with the parameters.
Batch: "PathToWhatsApp\Update.exe" --uninstall -s
Is it installed in the user context (C:\Users\USERNAME\AppData\Local) or system ("C:\Program Files" or "C:\Program Files (x86)")? That will change your approach.
Hi @Gerald, you may use this powershell script using Winget to remove WhatsApp - Windows Store App silently.
Create an online Kscript running with logged-in user.
# Check if winget is installed
Write-Host "Checking if Winget is Installed..."
If (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe) {
#Checks if winget executable exists and if the Windows Version is 1809 or higher
Write-Host "Winget Already Installed"
}
Else {
#Gets the computer's information
$ComputerInfo = Get-ComputerInfo
#Gets the Windows Edition
$OSName = if ($ComputerInfo.OSName) {
$ComputerInfo.OSName
} Else {
$ComputerInfo.WindowsProductName
}
If (((($OSName.IndexOf("LTSC")) -ne -1) -or ($OSName.IndexOf("Server") -ne -1)) -and (($ComputerInfo.WindowsVersion) -ge "1809")) {
Write-Host "Running Alternative Installer for LTSC/Server Editions"
# Switching to winget-install from PSGallery from asheroto
# Source: https://github.com/asheroto/winget-in...
Start-Process powershell.exe -Verb RunAs -ArgumentList "-command irm https://raw.githubusercontent.com/asheroto/winget-installer/master/winget-install.ps1 | iex | Out-Host" -WindowStyle NoNewWindow
}
ElseIf (((Get-ComputerInfo).WindowsVersion) -lt "1809") {
#Checks if Windows Version is too old for winget
Write-Host "Winget is not supported on this version of Windows (Pre-1809)"
}
Else {
#Installing Winget from the Microsoft Store
Write-Host "Winget not found, installing it now."
Start-Process powershell.exe -Verb RunAs -ArgumentList "-command irm https://raw.githubusercontent.com/asheroto/winget-installer/master/winget-install.ps1 | iex | Out-Host" -WindowStyle NoNewWindow
Write-Host "Winget Installed"
}
}
# Detect WhatsApp - Windows Store Version
If (Test-Path "$env:LOCALAPPDATA\Packages\5319275A.WhatsAppDesktop_cv1g1gvanyjgm") {
Write-Host "WhatsApp found, attempting to upgrade..."
winget upgrade --Name "WhatsApp" --Id "9NKSQGP7F2NH" -e -s=msstore -h --accept-source-agreements --accept-package-agreements
}
# Detect WhatsApp - Windows Store Version
If (Test-Path "$env:LOCALAPPDATA\Packages\5319275A.WhatsAppDesktop_cv1g1gvanyjgm") {
Write-Host "WhatsApp found, attempting to uninstall..."
winget uninstall --Name "WhatsApp" --Id "9NKSQGP7F2NH" -e --silent --accept-source-agreements
}
Else {
Write-Host "WhatsApp already uninstalled..."
}