|
zdh
初级用户
 
积分 52
发帖 20
注册 2006-11-4
状态 离线
|
『楼 主』:
搜索HOSTS并插入行
使用 LLM 解释/回答一下
想在c:里面找到HOSTS文件(可能是隐藏文件,无后缀的!),并在里面最后一行插入一行文字(如:I o U)。
感激各位帮助我的高手!;)
I want to find the HOSTS file (which may be a hidden file with no extension!) in the c: drive, and insert a line of text (such as "I o U") at the last line.
Grateful to all the experts who helped me! ;)
|
|
2006-11-18 05:43 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
for /f "tekons=*" %%? in ('dir /a-d/s/b c:\hosts') do (>>%%? echo I o U)
for /f "tokens=*" %%? in ('dir /a-d/s/b c:\hosts') do (>>%%? echo I o U)
|
|
2006-11-18 05:59 |
|
|
zdh
初级用户
 
积分 52
发帖 20
注册 2006-11-4
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
出错:
此时不应有 tekons=*"
我的HOSTS不一定在根C盘目录里啊,可能在C盘某个地方。
Error:
There should not be tekons=*" at this time
My HOSTS may not be in the root C drive directory, it may be somewhere in the C drive.
|
|
2006-11-18 06:07 |
|
|
NaturalJ0
银牌会员
    
积分 1181
发帖 533
注册 2006-8-14
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
改成 tokens
如果提示文件是只读,那最好先 attrib 处理一下。
Change to tokens.
If the prompt file is read-only, it's best to handle it with attrib first.
|
|
2006-11-18 06:12 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
|
2006-11-18 06:19 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Originally posted by zdh at 2006-11-18 06:07:
出错:
此时不应有 tekons=*"
我的HOSTS不一定在根C盘目录里啊,可能在C盘某个地方。
汗,写错了
Originally posted by zdh at 2006-11-18 06:07:
Error:
At this time, there should not be tekons=*"
My HOSTS may not be in the root C drive directory, it may be in some place on the C drive.
Sweat, it was written wrong
|
|
2006-11-18 06:24 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2006-11-18 06:25 |
|
|
kht000
初级用户
 
积分 45
发帖 14
注册 2006-9-12
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
ATTRIB -A -R -H C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
ECHO I o U >> C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
win2003
ATTRIB -A -R -H C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
ECHO I o U >> C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
win2003
|
|
2006-11-18 09:56 |
|
|
tao0610
高级用户
    朦胧的世界
积分 579
发帖 218
注册 2006-10-24
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
想在drivers\etc下的hosts加入域名解析吧!
Want to add domain name resolution in the hosts under drivers\etc!
|
|
2006-11-18 13:34 |
|
|
zdh
初级用户
 
积分 52
发帖 20
注册 2006-11-4
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by tao0610 at 2006-11-18 01:34 AM:
想在drivers\etc下的hosts加入域名解析吧!
是啊!因为局域网里面用IP地址访问实在太麻烦了,能够解析就最好了!
Originally posted by tao0610 at 2006-11-18 01:34 AM:
Want to add domain name resolution in the hosts under drivers\etc!
Yeah! Because it's too cumbersome to access with IP addresses in the local area network. It would be best if it could be resolved!
|
|
2006-11-18 21:29 |
|
|
tao0610
高级用户
    朦胧的世界
积分 579
发帖 218
注册 2006-10-24
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
attrib -s -h %systemroot%\system32\drivers\etc\hosts
echo 202.108.22.5 www.baidu.com >> %systemroot%\system32\drivers\etc\hosts
attrib -s -h %systemroot%\system32\drivers\etc\hosts
echo 202.108.22.5 www.baidu.com >> %systemroot%\system32\drivers\etc\hosts
|
|
2006-11-19 15:25 |
|
|
hxuan999
中级用户
   DOS之日
积分 337
发帖 161
注册 2006-11-4
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
学习了
|

for /f %%h in (`echo hxuan`) do for /f %%x in (`echo hxuan`) do if %%h==%%x nul |
|
2006-11-23 07:28 |
|
|
Kinglion
铂金会员
       痴迷DOS者
积分 5798
发帖 1924
注册 2003-6-20 来自 金獅電腦軟體工作室
状态 离线
|
『第 13 楼』:
通过设置HOSTS设置DNS解析的批处理例
使用 LLM 解释/回答一下
@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
:ntgo
echo 221.212.188.60 www.kinglion.org >> %windir%\system32\drivers\etc\hosts
:end
@echo off
rem -----------------------------------------------
rem Powered by Kinglion Software Workroom
rem www.kinglion.org DNS Resolution Setup Program
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
:ntgo
echo 221.212.188.60 www.kinglion.org >> %windir%\system32\drivers\etc\hosts
:end
此帖被 +4 点积分 点击查看详情 评分人:【 lxmxn 】 | 分数: +4 | 时间:2007-4-26 01:23 |
|
|

熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
|
|
2007-4-26 00:55 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
Kinglion 兄考虑问题很全面哈。
Brother Kinglion, you consider issues very comprehensively.
|
|
2007-4-26 01:25 |
|
|
zbjit
新手上路

积分 6
发帖 4
注册 2008-9-24
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
13楼的脚本太好了,学习
The script on the 13th floor is great, learning
|
|
2008-9-24 10:03 |
|