programacion programa por para off lotes ejemplos ejecutar crear comandos batch bat avanzados avanzada archivos archivo windows-7 batch-file hosts

windows-7 - programa - if en batch



Windows Batch: ¿Cómo agregar entradas de host? (6)

Aquí está mi modificación de @rashy arriba. El script hace lo siguiente:

  • Verifica que tienes acceso, si no, lo solicita.
  • le permite ingresar en múltiples hosts en una lista
  • recorre la lista
  • Busca la línea que contiene el nombre de dominio y la elimina, luego la vuelve a agregar (en caso de que la dirección IP haya cambiado desde la última vez que se ejecutó el script).
  • Si el dominio no está ahí, simplemente lo agrega.

Este es el guión:

@echo off TITLE Modifying your HOSTS file COLOR F0 ECHO. :: BatchGotAdmin :------------------------------------- REM --> Check for permissions >nul 2>&1 "%SYSTEMROOT%/system32/cacls.exe" "%SYSTEMROOT%/system32/config/system" REM --> If error flag set, we do not have admin. if ''%errorlevel%'' NEQ ''0'' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%/getadmin.vbs" set params = %*:"=" echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%/getadmin.vbs" "%temp%/getadmin.vbs" del "%temp%/getadmin.vbs" exit /B :gotAdmin pushd "%CD%" CD /D "%~dp0" :-------------------------------------- :LOOP SET Choice= SET /P Choice="Do you want to modify HOSTS file ? (Y/N)" IF NOT ''%Choice%''=='''' SET Choice=%Choice:~0,1% ECHO. IF /I ''%Choice%''==''Y'' GOTO ACCEPTED IF /I ''%Choice%''==''N'' GOTO REJECTED ECHO Please type Y (for Yes) or N (for No) to proceed! ECHO. GOTO Loop :REJECTED ECHO Your HOSTS file was left unchanged>>%systemroot%/Temp/hostFileUpdate.log ECHO Finished. GOTO END :ACCEPTED setlocal enabledelayedexpansion ::Create your list of host domains set LIST=(diqc.oca wiki.oca) ::Set the ip of the domains you set in the list above set diqc.oca=192.168.111.6 set wiki.oca=192.168.111.4 :: deletes the parentheses from LIST set _list=%LIST:~1,-1% ::ECHO %WINDIR%/System32/drivers/etc/hosts > tmp.txt for %%G in (%_list%) do ( set _name=%%G set _value=!%%G! SET NEWLINE=^& echo. ECHO Carrying out requested modifications to your HOSTS file ::strip out this specific line and store in tmp file type %WINDIR%/System32/drivers/etc/hosts | findstr /v !_name! > tmp.txt ::re-add the line to it ECHO %NEWLINE%^!_value! !_name!>>tmp.txt ::overwrite host file copy /b/v/y tmp.txt %WINDIR%/System32/drivers/etc/hosts del tmp.txt ) ipconfig /flushdns ECHO. ECHO. ECHO Finished, you may close this window now. ECHO You should now open Chrome and go to "chrome://net-internals/#dns" (without quotes) ECHO then click the "clear host cache" button GOTO END :END ECHO. ping -n 11 192.0.2.2 > nul EXIT

Quiero usar esta secuencia de comandos por lotes para agregar nuevas entradas a mi archivo host automáticamente usando windows lotes.

Desafortunadamente, el script solo agrega una línea al archivo de hosts , también cuando ejecuto el script como administrador, ¿qué ocurre?

@echo off set hostspath=%windir%/System32/drivers/etc/hosts echo 62.116.159.4 ns1.intranet.de >> %hostspath% echo 217.160.113.37 ns2.intranet.de >> %hostpath% echo 89.146.248.4 ns3.intranet.de >> %hostpath% echo 74.208.254.4 ns4.intranet.de >> %hostpath% exit


Cree un nuevo archivo addHostEntry.bat con el siguiente contenido:

@echo off TITLE Modifying your HOSTS file COLOR F0 ECHO. :LOOP SET Choice= SET /P Choice="Do you want to modify HOSTS file ? (Y/N)" IF NOT ''%Choice%''=='''' SET Choice=%Choice:~0,1% ECHO. IF /I ''%Choice%''==''Y'' GOTO ACCEPTED IF /I ''%Choice%''==''N'' GOTO REJECTED ECHO Please type Y (for Yes) or N (for No) to proceed! ECHO. GOTO Loop :REJECTED ECHO Your HOSTS file was left unchanged>>%systemroot%/Temp/hostFileUpdate.log ECHO Finished. GOTO END :ACCEPTED SET NEWLINE=^& echo. ECHO Carrying out requested modifications to your HOSTS file FIND /C /I "mydomain.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 mydomain.com>>%WINDIR%/system32/drivers/etc/hosts ECHO Finished GOTO END :END ECHO. ping -n 11 127.0.0.1 > nul EXIT

¡Espero que esto ayude!


Error tipográfico simple hostspath vs hostpath ;)

@echo off set `hostspath`=%windir%/System32/drivers/etc/hosts echo 62.116.159.4 ns1.intranet.de >> `%hostspath%` echo 217.160.113.37 ns2.intranet.de >> `%hostpath%` echo 89.146.248.4 ns3.intranet.de >> `%hostpath%` echo 74.208.254.4 ns4.intranet.de >> `%hostpath%` exit


Estoy agregando esta respuesta en caso de que alguien más quiera almacenar el conjunto de entradas del host en un archivo txt formateado como el archivo host normal. Esto busca un delimitador TAB. Esto se basa en las respuestas de @Rashy y @ that0n3guy. Las diferencias se pueden notar alrededor del comando FOR.

@echo off TITLE Modifying your HOSTS file ECHO. :: BatchGotAdmin :------------------------------------- REM --> Check for permissions >nul 2>&1 "%SYSTEMROOT%/system32/cacls.exe" "%SYSTEMROOT%/system32/config/system" REM --> If error flag set, we do not have admin. if ''%errorlevel%'' NEQ ''0'' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%/getadmin.vbs" set params = %*:"=" echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%/getadmin.vbs" "%temp%/getadmin.vbs" del "%temp%/getadmin.vbs" exit /B :gotAdmin pushd "%CD%" CD /D "%~dp0" :-------------------------------------- :LOOP SET Choice= SET /P Choice="Do you want to modify HOSTS file ? (Y/N)" IF NOT ''%Choice%''=='''' SET Choice=%Choice:~0,1% ECHO. IF /I ''%Choice%''==''Y'' GOTO ACCEPTED IF /I ''%Choice%''==''N'' GOTO REJECTED ECHO Please type Y (for Yes) or N (for No) to proceed! ECHO. GOTO Loop :REJECTED ECHO Your HOSTS file was left unchanged. ECHO Finished. GOTO END :ACCEPTED setlocal enabledelayedexpansion ::Create your list of host domains for /F "tokens=1,2 delims= " %%A in (%WINDIR%/System32/drivers/etc/storedhosts.txt) do ( SET _host=%%B SET _ip=%%A SET NEWLINE=^& echo. ECHO Adding !_ip! !_host! REM REM ::strip out this specific line and store in tmp file type %WINDIR%/System32/drivers/etc/hosts | findstr /v !_host! > tmp.txt REM REM ::re-add the line to it ECHO %NEWLINE%^!_ip! !_host! >> tmp.txt REM ::overwrite host file copy /b/v/y tmp.txt %WINDIR%/System32/drivers/etc/hosts del tmp.txt ) ipconfig /flushdns ECHO. ECHO. ECHO Finished, you may close this window now. GOTO END :END ECHO. PAUSE EXIT

Ejemplo "Storeshosts.txt" (delimitado por tabulaciones)

127.0.0.1 mysite.com 168.1.64.2 yoursite.com 192.1.0.1 internalsite.com


Lo haría de esta manera, por lo que no terminará con entradas duplicadas si el script se ejecuta varias veces.

@echo off SET NEWLINE=^& echo. FIND /C /I "ns1.intranet.de" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^62.116.159.4 ns1.intranet.de>>%WINDIR%/System32/drivers/etc/hosts FIND /C /I "ns2.intranet.de" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^217.160.113.37 ns2.intranet.de>>%WINDIR%/System32/drivers/etc/hosts FIND /C /I "ns3.intranet.de" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^89.146.248.4 ns3.intranet.de>>%WINDIR%/System32/drivers/etc/hosts FIND /C /I "ns4.intranet.de" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^74.208.254.4 ns4.intranet.de>>%WINDIR%/System32/drivers/etc/hosts


Bueno escribo un guión que funciona muy bien.

> @echo off TITLE Modifying your HOSTS file COLOR F0 ECHO. > > :LOOP SET Choice= SET /P Choice="Do you want to modify HOSTS file ? > (Y/N)" > > IF NOT ''%Choice%''=='''' SET Choice=%Choice:~0,1% > > ECHO. IF /I ''%Choice%''==''Y'' GOTO ACCEPTED IF /I ''%Choice%''==''N'' GOTO > REJECTED ECHO Please type Y (for Yes) or N (for No) to proceed! ECHO. > GOTO Loop > > > :REJECTED ECHO Your HOSTS file was left > unchanged>>%systemroot%/Temp/hostFileUpdate.log ECHO Finished. GOTO > END > > > :ACCEPTED SET NEWLINE=^& echo. ECHO Carrying out requested > modifications to your HOSTS file FIND /C /I "www.youtube.com" > %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 ECHO > %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO 127.0.0.1 www.youtube.com>>%WINDIR%/system32/drivers/etc/hosts > FIND /C /I "youtube.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > youtube.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.zacebookpk.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.zacebookpk.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "zacebookpk.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > zacebookpk.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.proxysite.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.proxysite.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.proxfree.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.proxfree.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.hidemyass.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.hidemyass.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.freeyoutubeproxy.org" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.freeyoutubeproxy.org>>%WINDIR%/system32/drivers/etc/hosts FIND /C > /I "www.facebook.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.facebook.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "facebook.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > facebook.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.4everproxy.com " %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 www.4everproxy.com > >>%WINDIR%/system32/drivers/etc/hosts FIND /C /I "4everproxy.com " %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 ECHO > %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO 127.0.0.1 4everproxy.com >>%WINDIR%/system32/drivers/etc/hosts > FIND /C /I "proxysite.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > proxysite.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "proxfree.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > proxfree.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "hidemyass.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > hidemyass.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "freeyoutubeproxy.org" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > freeyoutubeproxy.org>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "unblockvideos.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > unblockvideos.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "proxyone.net" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > proxyone.net>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "kuvia.eu" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 kuvia.eu>>%WINDIR%/system32/drivers/etc/hosts > FIND /C /I "kuvia.eu/facebook-proxy" > %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 ECHO > %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO 127.0.0.1 > kuvia.eu/facebook-proxy>>%WINDIR%/system32/drivers/etc/hosts FIND /C > /I "hidemytraxproxy.ca" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > hidemytraxproxy.ca>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "github.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > github.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "funproxy.net" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > funproxy.net>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "en.wikipedia.org" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > en.wikipedia.org>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "wikipedia.org" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > wikipedia.org>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "dronten.proxylistpro.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > dronten.proxylistpro.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C > /I "proxylistpro.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > proxylistpro.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "zfreez.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > zfreez.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "zendproxy.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > zendproxy.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "zalmos.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > zalmos.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "zacebookpk.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > zacebookpk.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "youtubeunblockproxy.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > youtubeunblockproxy.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C > /I "youtubefreeproxy.net" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > youtubefreeproxy.net>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "youliaoren.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > youliaoren.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "xitenow.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > xitenow.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.youtubeproxy.pk" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.youtubeproxy.pk>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "youtubeproxy.pk" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > youtubeproxy.pk>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.youproxytube.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.youproxytube.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.webmasterview.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.webmasterview.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "webmasterview.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > webmasterview.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "youproxytube.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > youproxytube.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.vobas.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.vobas.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "vobas.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 vobas.com>>%WINDIR%/system32/drivers/etc/hosts > FIND /C /I "www.unblockmyweb.com" %WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO > %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO 127.0.0.1 > www.unblockmyweb.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "unblockmyweb.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > unblockmyweb.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.unblocker.yt" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.unblocker.yt>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "unblocker.yt" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > unblocker.yt>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.unblock.pk" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.unblock.pk>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "unblock.pk" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > unblock.pk>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.techgyd.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.techgyd.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "techgyd.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > techgyd.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.snapdeal.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.snapdeal.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "snapdeal.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > snapdeal.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.site2unblock.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.site2unblock.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "site2unblock.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > site2unblock.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.shopclues.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.shopclues.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "shopclues.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > shopclues.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.proxypk.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.proxypk.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "proxypk.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > proxypk.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.proxay.co.uk" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.proxay.co.uk>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "proxay.co.uk" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > proxay.co.uk>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.myntra.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.myntra.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "myntra.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > myntra.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.maddw.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.maddw.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "maddw.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 maddw.com>>%WINDIR%/system32/drivers/etc/hosts > FIND /C /I "www.lenskart.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.lenskart.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "lenskart.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > lenskart.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.kproxy.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.kproxy.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "kproxy.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > kproxy.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.jabong.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.jabong.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "jabong.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > jabong.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.flipkart.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.flipkart.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "flipkart.com" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ > 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO 127.0.0.1 > flipkart.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.facebook-proxyserver.com" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.facebook-proxyserver.com>>%WINDIR%/system32/drivers/etc/hosts FIND > /C /I "facebook-proxyserver.com" %WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO > %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% NEQ 0 > ECHO 127.0.0.1 > facebook-proxyserver.com>>%WINDIR%/system32/drivers/etc/hosts FIND /C > /I "www.dontfilter.us" %WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts > IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.dontfilter.us>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "dontfilter.us" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > dontfilter.us>>%WINDIR%/system32/drivers/etc/hosts FIND /C /I > "www.dolopo.net" %WINDIR%/system32/drivers/etc/hosts IF %ERRORLEVEL% > NEQ 0 ECHO %NEWLINE%>>%WINDIR%/system32/drivers/etc/hosts IF > %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 > www.dolopo.net>>%WINDIR%/system32/drivers/etc/hosts ECHO Finished GOTO > END > > > :END ECHO. ping -n 11 127.0.0.1 > nul EXIT