-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpotify Account Changer.bat
148 lines (133 loc) · 2.95 KB
/
Spotify Account Changer.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
@echo off
title Spotify Account Changer
set spotify=%appdata%\Spotify
set soggfy=full-path-to-soggfy
:menu
cls
echo [t] List
echo [s] Save
echo [r] Rename
echo [d] Delete
echo [l] Load
echo [g] Soggfy load
echo [u] Unload
echo [e] Export
echo [i] Import
set /p k=Select option:
if not defined k goto :invalid
if "%k%"=="t" goto :list
if "%k%"=="s" call :account save
if "%k%"=="r" call :account rename
if "%k%"=="d" call :account delete
if "%k%"=="l" call :account load
if "%k%"=="g" call :account soggload
if "%k%"=="u" call :prefs unload
if "%k%"=="e" call :prefs export
if "%k%"=="i" goto :import
goto :invalid
:account
cls
set action=%~1
set /p account=Enter account name:
if not defined account goto :invalid
if "%action%" neq "save" (
dir /b /a-d %spotify%\Users\%account% >nul 2>&1 || (
echo Account "%account%" does not exist!
pause >nul
goto :menu
)
)
call :%action% %account%
pause >nul
goto :menu
:prefs
cls
set action=%~1
if not exist %spotify%\prefs (
echo No account loaded!
pause >nul
goto :menu
)
call :%action%
pause >nul
goto :menu
:save
if not exist %spotify%\prefs (
echo No account loaded!
pause >nul
goto :menu
)
if exist %spotify%\Users\%account% set /p overwrite=Account exists, overwrite? [y/n]:
if /i "%overwrite%"=="n" goto :menu
copy %spotify%\prefs %spotify%\Users\%account% >nul 2>&1
echo Account "%account%" saved!
goto :EOF
:rename
set /p newname=Enter new name:
if not defined newname goto :invalid
ren %spotify%\Users\%account% %newname% >nul 2>&1
echo Account renamed to "%newname%"!
goto :EOF
:delete
del /q %spotify%\Users\%account% >nul 2>&1
echo Account "%account%" deleted!
goto :EOF
:load
taskkill /f /im spotify.exe >nul 2>&1
del /q %spotify%\prefs 2>nul
copy %spotify%\Users\%account% %spotify%\prefs >nul 2>&1
echo Account "%account%" loaded!
goto :EOF
:list
cls
dir /b /a-d %spotify%\Users 2>nul || (
echo No saved accounts found!
pause >nul
goto :menu
)
pause >nul
goto :menu
:soggload
cls
if "%soggfy%"=="full-path-to-soggfy" call :setSoggfyDir
taskkill /f /im spotify.exe >nul 2>&1
del /q %spotify%\prefs 2>nul
copy %spotify%\Users\%account% %soggfy%\prefs >nul 2>&1
echo Account "%account%" loaded via Soggfy!
goto :EOF
:unload
cls
taskkill /f /im spotify.exe >nul 2>&1
del /q %spotify%\prefs 2>nul
echo Account unloaded!
goto :EOF
:export
cls
set /p export=Enter export folder path:
if not defined export goto :invalid
if not exist %export% goto :invalid
copy %spotify%\prefs %export% >nul 2>&1
echo Account exported!
goto :EOF
:import
cls
set /p import=Enter prefs file path:
if not defined import goto :invalid
if not exist %import% goto :invalid
taskkill /f /im spotify.exe >nul 2>&1
copy %import% %spotify% >nul 2>&1
echo Account imported!
pause >nul
goto :menu
:setSoggfyDir
set /p o=Change soggfy directory? [y/n]:
if /i "%o%"=="n" goto :menu
set /p soggfy=Path:
if not exist %soggfy% goto :invalid
echo Path set!
goto :EOF
:invalid
cls
echo Invalid input!
pause >nul
goto :menu