- ·上一篇文章:恶搞:不停在D盘生成随机文件夹并读出来
- ·下一篇文章:批处理 智商测试器
- ·百度中搜索更多的关于“批处理写的网站屏蔽的工具”相关内容
- ·谷歌中搜索更多的关于“批处理写的网站屏蔽的工具”相关内容
- ******申明******
- 本站文章内容有部分为收录网络中其他网友内容,DOS资源站不保证所有的代码都适合你使用。
- 由于编辑匆忙,有可能造成某些脚本文件出现丢失代码或代码无法运行的情况,请网友根据情况自行修改。
- 如果能将出错部分反馈给我,那就更好了。
批处理写的网站屏蔽的工具
代码:
@echo off&title DOS资源站 www.cmdos.net
:start
cls
title 网站屏蔽工具
echo.&echo.
echo 网站屏蔽工具 制作ByX林 07.9.29
echo xlqlin@sina.com
echo.&echo.
echo ........................................................................
echo . 1.添加屏蔽网站 2.取消屏蔽网站 0.退出 .
echo ........................................................................
for /l %%i in (1,1,2) do echo.
set /p aa=请选择:
if /i %aa%==1 goto :add
if /i %aa%==0 exit
if /i %aa%==2 (goto :clear) else (goto :start)
:add
echo 使用说明:如要屏蔽百度则输入www.baidu.com然后回车即可。
for /l %%i in (1,1,2) do echo.
set /p a=请输入要屏蔽的网站:
echo 0.0.0.0 %a%>>%windir%\system32\drivers\etc\hosts
echo.&echo.
echo %a%已经屏蔽
ping /n 3 127.1>nul
goto start
:clear
for /l %%i in (1,1,2) do echo.
echo 使用说明:如要取消屏蔽百度则输入www.baidu.com然后回车即可。
for /l %%i in (1,1,2) do echo.
set /p b=请输入要取消屏蔽的网站:
for /f "tokens=* delims=" %%i in (%windir%\system32\drivers\etc\hosts) do (
if /I "%%i"=="0.0.0.0 %b% " (set "tmp=") else echo %%i>>%windir%\system32\drivers\etc\host
)
del %windir%\system32\drivers\etc\hosts
ren %windir%\system32\drivers\etc\host hosts
for /l %%i in (1,1,2) do echo.
echo 已经取消屏蔽%b%
ping /n 3 127.1>nul
goto start

