Copy codeThe Code is as follows: @ echo off & setlocal & cls
Echo/& echo \ & echo = & echo] & echo [& echo +
: Start
Set/p a = select mode (1: blocked websites 2: Accelerated Access 3: deleted blocked websites 4: Exited ):
If not defined a goto start
If % a % equ 1 (echo/& goto)
If % a % equ 2 (echo/& goto B)
If % a % equ 3 (echo/& goto c)
If % a % equ 4 (cls & goto: eof)
Cls
Echo input error. Press any key to start again ......
Pause> nul
Echo/& echo \ & echo = & echo] & echo [& echo +
Goto start
:
Set/p B = enter the address of the website to be blocked (for example, www.baidu.com ):
>>% Systemroot % \ system32 \ drivers \ etc \ hosts echo 0.0.0.0% B %
Echo ********* setting complete ********
Goto: eof
: B
Set/p B = enter the IP address of the host to accelerate access (for example, 192.168.1.6 ):
Set/p bb = enter the host domain name (for example, www.baidu.com) for accelerated access ):
>>% Systemroot % \ system32 \ drivers \ etc \ hosts echo % B % bb %
Echo ********* setting complete ********
Goto: eof
: C
Set/p B = enter the address of the website that has been blocked:
Pushd % systemroot % \ system32 \ drivers \ etc \
> Nul findstr/I "\ <% B % \>" > Hosts. pp findstr/vi "\ <% B % \>" Del/f/q hosts
Ren hosts. pp hosts
Popd
Echo ********* setting complete ********
Goto: eof