Missing args (#225)

Add title to bat windows
This commit is contained in:
crazy-max 2016-12-22 16:30:26 +01:00
parent 6da8deaf03
commit ff05417f78
3 changed files with 79 additions and 73 deletions

View File

@ -1,4 +1,5 @@
@ECHO OFF
TITLE Make Hosts
if not exist "%WINDIR%\py.exe" (
ECHO :: ERROR :: Python 3.5 Runtime NOT FOUND...

View File

@ -225,7 +225,7 @@ sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder
|`makeHostsWindows.bat` BATCH file will create various alternate hosts files by combining and adding the gambling, porn, and social media extensions. You need to be connected to the Internet. This file REQUIRED installed Python 3.5.x runtime environment in Windows System. Launch this file as normal user.|
:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|Run `updateHostsWindows.bat` BATCH file will replace hosts file and reload DNS cache in Windows System. You need to be connected to the Internet. This file REQUIRED installed Python 3.5.x runtime environment in Windows System.|
|`updateHostsWindows.bat` BATCH file will replace hosts file and reload DNS cache in Windows System. You need to be connected to the Internet. This file REQUIRED installed Python 3.5.x runtime environment in Windows System.|
:---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|If you want using huge hosts file with merged [hphosts](https://www.hosts-file.net) (NOT INCLUDED HERE) you need to DISABLE and STOP `Dnscache` service before you replace hosts file in Windows Systems. You have been warned.|

View File

@ -3,6 +3,8 @@
:: Next DNS Cache will be refreshed.
:: THIS BAT FILE WILL BE LAUNCHED WITH ADMINISTRATOR PRIVILIGES
@ECHO OFF
SETLOCAL EnableDelayedExpansion
TITLE Update Hosts
VER | FINDSTR /L "5.1." > NUL
IF %ERRORLEVEL% EQU 0 GOTO START
@ -10,12 +12,16 @@ IF %ERRORLEVEL% EQU 0 GOTO START
VER | FINDSTR /L "5.2." > NUL
IF %ERRORLEVEL% EQU 0 GOTO START
:UAC_ADMIN
CLS
IF "%1"=="" GOTO CHECK_UAC
IF "%1"=="start" GOTO START
:CHECK_UAC
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%ERRORLEVEL%' NEQ '0' (
If '%ERRORLEVEL%' NEQ '0' (
ECHO Requesting administrative privileges...
GOTO UAC_PROMPT
) else (
) Else (
GOTO ADMIN
)
@ -26,10 +32,8 @@ ECHO UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%TEMP%\getadmin.vbs"
EXIT /B
:ADMIN
if exist "%TEMP%\getadmin.vbs" (
DEL "%TEMP%\getadmin.vbs"
)
pushd "%CD%"
IF EXIST "%TEMP%\getadmin.vbs" ( DEL "%TEMP%\getadmin.vbs" )
PUSHD "%CD%"
CD /D "%~dp0"
CD %CD%
%COMSPEC% /c "updateHostsWindows.bat" start
@ -70,3 +74,4 @@ ipconfig /flushdns
GOTO END
:END
ENDLOCAL