@echo off&color 0f&title URL mask/unlock
:: By the small building one night to listen to spring rain
: Loop
Setlocal enabledelayedexpansion
Set WJM=C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Set "str=127.0.0.1"
Set "Xsxx=echo\&echo Note: This operation requires the consent of the antivirus software. "
Set "Xsxx=%xsxx%&echo ==================================&echo\"
cls&%xsxx%
Echo\&echo below are the URLs that have been blocked &echo ======================&echo\
for/f "Tokens=1* delims="%%a in (%wjm%\hosts) do (
If "%%a" = = "127.0.0.1" set/a xs+=1
If!xs! Geq 2 (
set/a num+=1
Set!num!=%%b&echo ^ (!num!^)%%b
)
Set No=%%a%%b
)
Echo\
If "%no%" = = "127.0.0.1 localhost" (Cls&%xsxx%&echo\&echo currently does not have a blocked URL.
Echo =====================&echo\&echo\&echo\&echo\)
If defined Pinbi goto Jiec
If defined Pinbi3 Goto Quan
Echo\&echo Please select 1 screen URL, 2 remove shield. 3 Remove all shielding. &echo\
set/p xuan= Please select [1,2,3]?
If "%xuan%" = = "2" (Endlocal&set Pinbi=a&goto Loop)
If "%xuan%" = = "3" (Endlocal&set Pinbi3=%num%&goto Loop)
cls&%xsxx%
Echo\&echo Please enter a "single" url that requires "masking".
Echo\&echo or first in "a document" to enter all the URLs to be blocked, one line.
Echo\&echo here, enter the document name (including the full path and suffix name), which can be added in batches.
Echo\&echo Press "Enter" or "point Close button" to exit ... &echo\
set/p wdm= Please enter a document name or URL:
If "%wdm%" = "" Exit
If not exist%wdm% set wdm= "%wdm%"
for/f "delims="%%a in (%wdm%) do (
Color Cf&echo!str!%%a>>%wjm%\hosts
)
Cls&echo\&echo Shielding Success ...
Endlocal&set pinbi=
Goto Loop
: Jiec
Echo\&echo Enter the number on the front of the URL that has been blocked, and remove the corresponding URL.
Echo\&echo to unlock, you can enter multiple serial number, separated by a space. such as: 1 2 5 10 (ie: Lifting 1, 2, 5, 10)
Echo\&echo Press "Enter" or "point Close button" to exit ... &echo\
set/p wz= Please enter the serial number:
If not defined WZ exit
: Quan
Cd.>%wjm%\hosts1
Color 1f
If defined Pinbi3 for/l%%i in (1 1%pinbi3%) do set wz=!wz!%%i
for/f "delims="%%a in (%wjm%\hosts) do (
Set pin=
For%%i in (%wz%) do if%%a "= ="!str!! %%i! "Set Pin=a
If not defined pin echo%%a>>%wjm%\hosts1
)
del/q%wjm%\hosts
ren%wjm%\hosts1 hosts
del/q%wjm%\hosts1
Cls&echo\&echo Unlock success ...
Endlocal&set Pinbi=&set pinbi3=
Goto Loop
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.