Originally posted by Hanyeguxing at 2010-12-11 18:52:
楼主“echo.type 1.txt”干什么?
谢谢!现在好了。
我是想用HOST阻止网址(阻止一打开网页弹好多广告的那些)
set list1=.\Website.txt '里面是广告的网址
set list2=%windir%\system32\drivers\etc\hosts
for /f "tokens=1,2 delims==" %%i in (%list1%) do (
set Website=%%i
type !list2! |find "!Website!" 1>2>nul
if !ERRORLEVEL! neq 0 (
echo.127.0.0.1 !Website!>>!list2!)
)
Originally posted by Hanyeguxing at 2010-12-11 18:52:
What is the purpose of the building "echo.type 1.txt"?
Thank you! It's okay now.
I want to use HOST to block URLs (block those annoying ads that pop up as soon as you open a web page)
set list1=.\Website.txt 'Inside are the URLs of ads
set list2=%windir%\system32\drivers\etc\hosts
for /f "tokens=1,2 delims==" %%i in (%list1%) do (
set Website=%%i
type !list2! |find "!Website!" 1>2>nul
if !ERRORLEVEL! neq 0 (
echo.127.0.0.1 !Website!>>!list2!)
)