updateHostsWindows.bat: add file
authorTomasz Przybył <redacted>
Wed, 15 Jun 2016 12:55:59 +0000 (14:55 +0200)
committerTomasz Przybył <redacted>
Wed, 15 Jun 2016 12:55:59 +0000 (14:55 +0200)
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.

updateHostsWindows.bat [new file with mode: 0644]

diff --git a/updateHostsWindows.bat b/updateHostsWindows.bat
new file mode 100644 (file)
index 0000000..2d23ebd
--- /dev/null
@@ -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
\ No newline at end of file
git clone https://git.99rst.org/PROJECT