mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +00:00
updateHostsWindows.bat: expand
- check if python runtime 3.5 is available on system - update automaticaly hosts file before replace them
This commit is contained in:
@@ -3,12 +3,34 @@
|
|||||||
:: Next DNS Cache will be refreshed.
|
:: Next DNS Cache will be refreshed.
|
||||||
:: YOU NEED RUNNING THIS BAT FILE IN COMMAND LINE PROMPT WITH ADMINISTRATOR PRIVILIGES
|
:: YOU NEED RUNNING THIS BAT FILE IN COMMAND LINE PROMPT WITH ADMINISTRATOR PRIVILIGES
|
||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
|
|
||||||
|
if not exist "%WINDIR%\py.exe" (
|
||||||
|
ECHO :: ERROR :: Python 3.5 Runtime NOT FOUND...
|
||||||
|
ECHO :: ERROR :: Download and install lastest Python 3.5 for Windows from https://www.python.org/downloads/
|
||||||
|
ECHO :: ERROR :: Exit...
|
||||||
|
GOTO END
|
||||||
|
) ELSE (
|
||||||
|
GOTO PY35RT
|
||||||
|
)
|
||||||
|
:PY35RT
|
||||||
|
if not exist "%PROGRAMFILES%\python35\Python35.dll" (
|
||||||
|
ECHO :: ERROR :: Python 3.5 Runtime NOT FOUND...
|
||||||
|
ECHO :: ERROR :: Download and install lastest Python 3.5 for Windows from https://www.python.org/downloads/
|
||||||
|
ECHO :: ERROR :: Exit...
|
||||||
|
GOTO END
|
||||||
|
) ELSE (
|
||||||
|
ECHO :: INFO :: Python 3.5 Runtime was found...
|
||||||
|
ECHO :: INFO :: Running main script...
|
||||||
|
GOTO DNSCHECK
|
||||||
|
)
|
||||||
|
:DNSCHECK
|
||||||
if not exist "%WINDIR%\System32\drivers\etc\hosts.skel" (
|
if not exist "%WINDIR%\System32\drivers\etc\hosts.skel" (
|
||||||
COPY %WINDIR%\System32\drivers\etc\hosts %WINDIR%\System32\drivers\etc\hosts.skel
|
COPY %WINDIR%\System32\drivers\etc\hosts %WINDIR%\System32\drivers\etc\hosts.skel
|
||||||
GOTO :CLEARDNS
|
GOTO :CLEARDNS
|
||||||
)
|
)
|
||||||
:CLEARDNS
|
:CLEARDNS
|
||||||
|
updateHostsFile.py -a
|
||||||
COPY hosts %WINDIR%\System32\drivers\etc\
|
COPY hosts %WINDIR%\System32\drivers\etc\
|
||||||
ipconfig /flushdns
|
ipconfig /flushdns
|
||||||
GOTO END
|
GOTO END
|
||||||
:END
|
:END
|
||||||
|
|||||||
Reference in New Issue
Block a user