[ Last edited by zhanghong1 on 2007-8-28 at 03:24 PM ]作者: zhanghong1 时间: 2007-8-28 15:27 @echo off
cd /d %windir%\system32\drivers\etc
set ip=127.0.0.1
set host=www.abc.com
echo #change test>temp
for /f "eol=# tokens=1,2" %%i in (hosts) do if %%i==%ip% (echo %%i %host%>>temp) else (echo %%i %%j>>temp)
del hosts.bak
ren hosts hosts.bak
ren temp hosts
现在直接删除上边的那个for语句了~~重建hosts文件..呵呵..谢谢~~一时给忘了~~
[ Last edited by zhanghong1 on 2007-8-28 at 03:29 PM ]