用CMD或者bat修改host文件
第一行代码标识 取消host的只读属性
第二行写入
attrib -R C:\WINDOWS\system32\drivers\etc\hosts
@echo 127.0.0.1 baidu.com >>C:\WINDOWS\system32\drivers\etc\hosts @TOC
本文介绍如何通过CMD或bat脚本解除Host文件的只读属性并进行修改,具体包括使用attrib命令取消只读属性,以及如何追加新的DNS映射到Host文件中。
第一行代码标识 取消host的只读属性
第二行写入
attrib -R C:\WINDOWS\system32\drivers\etc\hosts
@echo 127.0.0.1 baidu.com >>C:\WINDOWS\system32\drivers\etc\hosts @TOC
3884
6707
1万+
2106

被折叠的 条评论
为什么被折叠?
