forked from amd64fox/Uninstall-Spotify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Uninstall-Spotify.bat
40 lines (31 loc) · 949 Bytes
/
Uninstall-Spotify.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@echo off
setlocal enabledelayedexpansion
REM Reset permissions for Spotify Update folder
if exist "%localappdata%\Spotify\Update" (
icacls "%localappdata%\Spotify\Update" /reset /T > NUL 2>&1
)
set actions=0
REM Uninstall Spotify if it exists
if exist "%appdata%\Spotify\Spotify.exe" (
start "" /wait "%appdata%\Spotify\Spotify.exe" /UNINSTALL /SILENT
set /a actions+=1
)
timeout /t 1 > NUL 2>&1
REM Remove Spotify data folders
for %%d in ("%appdata%\Spotify" "%localappdata%\Spotify") do (
if exist "%%d" (
rd /s/q "%%d" > NUL 2>&1
set /a actions+=1
)
)
REM Delete SpotifyUninstall.exe if it exists
if exist "%temp%\SpotifyUninstall.exe" (
del /s /q "%temp%\SpotifyUninstall.exe" > NUL 2>&1
set /a actions+=1
)
if !actions! == 0 (
echo Spotify is not installed or not found
) else (
echo Spotify has been successfully uninstalled
)
pause & exit