Uninstalling Spotify
Has anyone encountered the uninstall command switch for SpotifySetup.exe or any other method to unattendely uninstall Spotifiy?
When i use /uninstall the uninstallation starts, nevertheless a dialog asks the user "Are you sure you want to uninstall Spotify?"
Switches like "/qu" ; "/quninstall" ; "/uninstall /yes" don't work. Im trying to uninstall it silently, so the user doesn't even see a message.
So far, at least, I was able to copy the SpWebInst0.exe from %appdata%\Spotify although does not solve my problem yet.
Thank you for your appreciated help.
Answers (4)
This is the best I could locate, a Powershell Script:
https://www.reddit.com/r/SCCM/comments/5ipfql/spotify_removal_script/
Very well documented.
Comments:
-
Thank you. You put me on the right track. That PS-Script works indeedly.
In order to run that in KACE, I first start a Online-Shell-Script (script.bat) including:
powershell.exe -nologo -executionpolicy bypass -noprofile -file uninstall.ps1
In Dependendies I put that "uninstall.ps1". - SGV AG 6 years ago
Top Answer
"C:\Users\Admin\AppData\Roaming\Spotify\Spotify.exe" /UNINSTALL /SILENT
If you want an easy installation/deinstallation, then use the Offline Installer with following parameters to install:
SpotifyFullSetup.exe /PROGRAM_FILES /SILENT
This install spotify in C:\Program Files(x86)\Spotify
Thats usually much better. Better to install/uninstall as local system in an evironment with e.g SCCM.
And then uninstall:
"C:\Program Files (x86)\Spotify\Spotify.exe" /UNINSTALL /SILENT
Solution A:
%APPDATA%\Spotify\Spotify.exe /UNINSTALL /SILENT
Solution B:
1. In order to run this in KACE as a script start an Online-Shell-Script (script.bat) containing:
powershell.exe -nologo -executionpolicy bypass -noprofile -file uninstall.ps1
2. In Dependendies add "uninstall.ps1" containing following PS-Script:
# set working directory
$CurrentLocation = Split-Path -Parent $MyInvocation.MyCommand.Path;
# end running processes
$RunningApp = Get-Process -Name "spotify*"
If ($RunningApp) {
Stop-Process -InputObject $RunningApp -Force
}
# manually delete spotify for each user
$UserFolders = Get-ChildItem -Directory "c:\users"
ForEach ($Folder in $UserFolders) {
$WorkingDir = "C:\\Users\\" + "$Folder"
If (Test-Path $WorkingDir\appdata\roaming\spotify) {
Start-Process -FilePath $WorkingDir\appdata\roaming\spotify\spotify.exe -ArgumentList "/uninstall /silent"
Start-Sleep -s 10
Remove-Item $WorkingDir\appdata\roaming\spotify -Force -Recurse
Remove-Item $WorkingDir\appdata\local\spotify -Force -Recurse
Remove-Item $WorkingDir\desktop\spotify.lnk -Force -Recurse
}
}
# remove leftover listing in programs and features
$UserKey = Get-ChildItem -Path Microsoft.PowerShell.Core\Registry::HKEY_USERS
ForEach ($Key in $UserKey) {
If (Test-Path Microsoft.PowerShell.Core\Registry::\$Key\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Spotify) {
Remove-Item Microsoft.PowerShell.Core\Registry::\$Key\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Spotify -Force -Recurse
}
}
Thank you Channeler and kitco for your great help!
Try with powershell
$RunningApp =Get-Process -Name "spotify*"
If ($RunningApp){Stop-Process -InputObject $RunningApp -Force}
Get-AppPackage -NAMESpotifyAB.SpotifyMusic | Remove-AppPackage
This will stop the process and then uninstall it, something interesting that we found is that the application is installed in C:\Program Files\WindowsApps and that is a folder to which you do not have permission.