-
-
Notifications
You must be signed in to change notification settings - Fork 160
/
windows-uninstall-hosts.bat
30 lines (24 loc) · 1.15 KB
/
windows-uninstall-hosts.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
:: ULTIMATE HOSTS BLACKLIST
:: REPO: https://github.com/Ultimate-Hosts-Blacklist/Ultimate.Hosts.Blacklist
:: Copyright (c) 2020 Ultimate Hosts Blacklist - @Ultimate-Hosts-Blacklist
:: Copyright (c) 2017, 2018, 2019, 2020 Mitchell Krog - @mitchellkrogza
:: Copyright (c) 2017, 2018, 2019, 2020 Nissar Chababy - @funilrys
:: This script will first create a backup of the original or current hosts
:: file and save it in a file titled "hosts.bak"
:: It will then download the latest updated hosts file
:: Finally the DNS cache will also be refreshed.
:: THIS BAT FILE MUST BE LAUNCHED WITH ADMINISTRATOR PRIVILEGES
:: @ECHO OFF
TITLE Uninstall Hosts
:: Check if we are administrator. If not, exit immediately.
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if %ERRORLEVEL% NEQ 0 (
ECHO This script must be run with administrator privileges!
ECHO Please launch command prompt as administrator. Exiting...
EXIT /B 1
)
COPY %WINDIR%\System32\drivers\etc\hosts.original %WINDIR%\System32\drivers\etc\hosts
)
:: Flush the DNS cache
ipconfig /flushdns
echo ALL DONE !!! Original hosts file restored !!