想在c:里面找到HOSTS文件(可能是隐藏文件,无后缀的!),并在里面最后一行插入一行文字(如:I o U)。
感激各位帮助我的高手!;)作者: vkill 时间: 2006-11-18 05:59 for /f "tekons=*" %%? in ('dir /a-d/s/b c:\hosts') do (>>%%? echo I o U)作者: zdh 时间: 2006-11-18 06:07 出错:
此时不应有 tekons=*"
我的HOSTS不一定在根C盘目录里啊,可能在C盘某个地方。作者: NaturalJ0 时间: 2006-11-18 06:12 改成 tokens
如果提示文件是只读,那最好先 attrib 处理一下。作者: ccwan 时间: 2006-11-18 06:19 楼上正解。作者: vkill 时间: 2006-11-18 06:24
Quote:
Originally posted by zdh at 2006-11-18 06:07:
出错:
此时不应有 tekons=*"
我的HOSTS不一定在根C盘目录里啊,可能在C盘某个地方。
汗,写错了作者: 不得不爱 时间: 2006-11-18 06:25 for /f "tokens=*" %%a in ('dir /a-d/s/b c:\hosts') do echo I o U>>%%a作者: kht000 时间: 2006-11-18 09:56 ATTRIB -A -R -H C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
ECHO I o U >> C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
win2003作者: tao0610 时间: 2006-11-18 13:34 想在drivers\etc下的hosts加入域名解析吧!作者: zdh 时间: 2006-11-18 21:29
Quote:
Originally posted by tao0610 at 2006-11-18 01:34 AM:
想在drivers\etc下的hosts加入域名解析吧!
@echo off
rem -----------------------------------------------
rem Powered by Kinglion Software Workroom
rem www.kinglion.org DNS 解析设置程序
rem Don't modify this file
rem -----------------------------------------------
if exist %ComSpec% goto nt
:9x
if not exist %windir%\hosts goto win9xgo
if not exist %windir%\hosts.bak goto win9xgo
del %windir%\hosts.bak
ren %windir%\hosts %windir%\hosts.bak
:win9xgo
echo 221.212.188.60 www.kinglion.org >> %windir%\hosts
goto end
:nt
if not exist %windir%\system32\drivers\etc\hosts goto ntgo
if not exist %windir%\system32\drivers\etc\hosts.bak goto ntgo
del %windir%\system32\drivers\etc\hosts.bak
ren %windir%\system32\drivers\etc\hosts %windir%\system32\drivers\etc\hosts.bak