Issue #225: fix - revert updateHostsWindows.bat to 014e7c3ee
authorSteven Black <redacted>
Thu, 22 Dec 2016 15:28:24 +0000 (10:28 -0500)
committerSteven Black <redacted>
Thu, 22 Dec 2016 15:28:24 +0000 (10:28 -0500)
updateHostsWindows.bat

index 37c4a84cb1ed3c49b20dcdd3f43b9e67fdfe54b4..5151a6b5e301b69b84790c1d26af33facbf28f9c 100644 (file)
@@ -1,41 +1,9 @@
 :: 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.
-:: THIS BAT FILE WILL BE LAUNCHED WITH ADMINISTRATOR PRIVILIGES
+:: YOU NEED RUNNING THIS BAT FILE IN COMMAND LINE PROMPT WITH ADMINISTRATOR PRIVILIGES
 @ECHO OFF
 
-VER | FINDSTR /L "5.1." > NUL
-IF %ERRORLEVEL% EQU 0 GOTO START
-
-VER | FINDSTR /L "5.2." > NUL
-IF %ERRORLEVEL% EQU 0 GOTO START
-
-:UAC_ADMIN
->nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"  
-if '%ERRORLEVEL%' NEQ '0' (
-    ECHO Requesting administrative privileges...
-    GOTO UAC_PROMPT
-) else (
-    GOTO ADMIN
-)
-
-:UAC_PROMPT
-ECHO Set UAC = CreateObject^("Shell.Application"^) > "%TEMP%\getadmin.vbs"
-ECHO UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%TEMP%\getadmin.vbs"
-"%TEMP%\getadmin.vbs"
-EXIT /B
-
-:ADMIN
-if exist "%TEMP%\getadmin.vbs" (
-    DEL "%TEMP%\getadmin.vbs"
-)
-pushd "%CD%"
-CD /D "%~dp0"
-CD %CD%
-%COMSPEC% /c "updateHostsWindows.bat" start
-EXIT
-
-:START
 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/
@@ -43,8 +11,7 @@ if not exist "%WINDIR%\py.exe" (
        GOTO END
 ) ELSE ( 
        GOTO PY35RT
-)
-
+ )
 :PY35RT
 if not exist "%LOCALAPPDATA%\Programs\Python\Python35\Python35.dll" (
        ECHO :: ERROR :: Python 3.5 Runtime NOT FOUND...
@@ -55,18 +22,15 @@ if not exist "%LOCALAPPDATA%\Programs\Python\Python35\Python35.dll" (
        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" (
        COPY %WINDIR%\System32\drivers\etc\hosts %WINDIR%\System32\drivers\etc\hosts.skel
        GOTO :CLEARDNS
 )
-
 :CLEARDNS
-updateHostsFile.py -a
-COPY hosts %WINDIR%\System32\drivers\etc\
-ipconfig /flushdns
-GOTO END
-
+       updateHostsFile.py -a
+       COPY hosts %WINDIR%\System32\drivers\etc\
+       ipconfig /flushdns
+       GOTO END
 :END
git clone https://git.99rst.org/PROJECT