个人常用批处理代码
作者:刚子 日期:2009-06-20
1.删除指定文件
del E:\1\1.txt
2.给hosts文件添加网址
(说明一下,第一行的内容是为了先增加一个空行写的)
echo. >>%systemroot%/system32/drivers/etc/hosts
echo 58.51.84.116 www.baidu.com>>%systemroot%/system32/drivers/etc/hosts
3.一键恢复hosta内容
echo 127.0.0.1 localhost>>C:\WINDOWS\system32\drivers\etc\hosts.txt
copy C:\WINDOWS\system32\drivers\etc\hosts.txt C:\WINDOWS\system32\drivers\etc\hosts
del E:\1\1.txt
2.给hosts文件添加网址
(说明一下,第一行的内容是为了先增加一个空行写的)
echo. >>%systemroot%/system32/drivers/etc/hosts
echo 58.51.84.116 www.baidu.com>>%systemroot%/system32/drivers/etc/hosts
3.一键恢复hosta内容
echo 127.0.0.1 localhost>>C:\WINDOWS\system32\drivers\etc\hosts.txt
copy C:\WINDOWS\system32\drivers\etc\hosts.txt C:\WINDOWS\system32\drivers\etc\hosts
评论: 0 | 引用: 0 | 查看次数: -
发表评论
上一篇
下一篇

文章来自:
Tags: