mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-07-05 03:56:00 +02:00
updateHostsWindows.bat: add file
This script will create in first running backup of ORIGINAL/CURRENT hosts file in hosts.skel file if file does not exists. If hosts.skel file exists, then NEW copy with customized unified hosts file will be copied to proper path. Next DNS Cache will be refreshed.
This commit is contained in:
parent
70a27055d7
commit
0cf8659d2e
14
updateHostsWindows.bat
Normal file
14
updateHostsWindows.bat
Normal file
|
@ -0,0 +1,14 @@
|
|||
:: This script will create in first running backup of ORIGINAL/CURRENT hosts file in hosts.skel file.
|
||||
:: If hosts.skel file exists, then NEW copy with customized unified hosts file will be copied to proper path.
|
||||
:: Next DNS Cache will be refreshed.
|
||||
:: YOU NEED RUNNING THIS BAT FILE IN COMMAND LINE PROMPT WITH ADMINISTRATOR PRIVILIGES
|
||||
@ECHO OFF
|
||||
if not exist "%WINDIR%\System32\drivers\etc\hosts.skel" (
|
||||
COPY %WINDIR%\System32\drivers\etc\hosts %WINDIR%\System32\drivers\etc\hosts.skel
|
||||
GOTO :CLEARDNS
|
||||
)
|
||||
:CLEARDNS
|
||||
COPY hosts %WINDIR%\System32\drivers\etc\
|
||||
ipconfig /flushdns
|
||||
GOTO END
|
||||
:END
|
Loading…
Reference in New Issue
Block a user