This repository has been archived by the owner on Sep 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdater block.bat
74 lines (71 loc) · 3.44 KB
/
updater block.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
@echo off
call :RequestAdminElevation "%~dpfs0" %* || goto:eof
mode con: cols=100 lines=50
title -Spotify Adblock (by: Stowe)-
echo +++++++++++++++++++++++++++++++++++++++++++++++++
echo + -Script Adblock Spotify V 1.0.8-v1 +
echo + Test and make by @Corey-Stowe (2020/11/07) +
echo + Block spotify upgrade +
echo
echo +++++++++++++++++++++++++++++++++++++++++++++++++
echo.
echo For the best experience, buy premium on spotify
echo.
pause
TASKKILL /IM Spotify.exe /F 2> nul
copy %SystemRoot%\system32\drivers\etc\hosts %SystemRoot%\system32\drivers\etc\hosts.backup
echo. >>"%SystemRoot%\system32\drivers\etc\hosts"
echo. >>"%SystemRoot%\system32\drivers\etc\hosts"
echo # disableSpotify update check>>"%SystemRoot%\system32\drivers\etc\hosts"
echo 0.0.0.0 upgrade.spotify.com>>"%SystemRoot%\system32\drivers\etc\hosts"
echo 0.0.0.0 www.spotify-desktop.com>>"%SystemRoot%\system32\drivers\etc\hosts"
echo 0.0.0.0 sto3-accesspoint-a88.sto3.spotify.net>>"%SystemRoot%\system32\drivers\etc\hosts"
echo 0.0.0.0 upgrade.scdn.co>>"%SystemRoot%\system32\drivers\etc\hosts"
echo 0.0.0.0 prod.spotify.map.fastlylb.net>>"%SystemRoot%\system32\drivers\etc\hosts"
echo # >>"%SystemRoot%\system32\drivers\etc\hosts"
cd %appdata%\Spotify\Apps
del /f /q ad.spa
IF NOT EXIST ad.spa echo. >ad.spa
cd..
Start Spotify.exe
msg * ok!
exit
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:RequestAdminElevation FilePath %* || goto:eof
::
:: By: Stowe, v1.0.8(1.0.0v1) - 2020/11/07 - Changed the admin rights test method from cacls to fltmc
:: Func: opens an admin elevation prompt. If elevated, runs everything after the function call, with elevated rights.
:: Returns: -1 if elevation was requested
:: 0 if elevation was successful
:: 1 if an error occured
::
:: USAGE:
:: If function is copied to a batch file:
:: call :RequestAdminElevation "%~dpf0" %* || goto:eof
::
:: If called as an external library (from a separate batch file):
:: set "_DeleteOnExit=0" on Options
:: (call :RequestAdminElevation "%~dpf0" %* || goto:eof) && CD /D %CD%
::
:: If called from inside another CALL, you must set "_ThisFile=%~dpf0" at the beginning of the file
:: call :RequestAdminElevation "%_ThisFile%" %* || goto:eof
::
:: If you need to use the ! char in the arguments, the calling must be done like this, and afterwards you must use %args% to get the correct arguments:
:: set "args=%* "
:: call :RequestAdminElevation ..... use one of the above but replace the %* with %args:!={a)%
:: set "args=%args:{a)=!%"
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setlocal ENABLEDELAYEDEXPANSION & set "_FilePath=%~1"
if NOT EXIST "!_FilePath!" (echo/Read RequestAdminElevation usage information)
:: UAC.ShellExecute only works with 8.3 filename, so use %~s1
set "_FN=_%~ns1" & echo/%TEMP%| findstr /C:"(" >nul && (echo/ERROR: %%TEMP%% path can not contain parenthesis &pause &endlocal &fc;: 2>nul & goto:eof)
:: Remove parenthesis from the temp filename
set _FN=%_FN:(=%
set _vbspath="%temp:~%\%_FN:)=%.vbs" & set "_batpath=%temp:~%\%_FN:)=%.bat"
:: Test if we gave admin rights
fltmc >nul 2>&1 || goto :_getElevation
:: Elevation successful
(if exist %_vbspath% ( del %_vbspath% )) & (if exist %_batpath% ( del %_batpath% ))
:: Set ERRORLEVEL 0, set original folder and exit
endlocal & CD /D "%~dp1" & ver >nul & goto:eof
:_getElevation