hosts文件丢失会对电脑的正常使用造成影响,比如电脑连不上网,或者打不开网页等等。很多用户遇到hosts文件丢失的问题都很头痛,不知道该怎么解决?今天自由互联小编为大家整理了
hosts文件丢失会对电脑的正常使用造成影响,比如电脑连不上网,或者打不开网页等等。很多用户遇到hosts文件丢失的问题都很头痛,不知道该怎么解决?今天自由互联小编为大家整理了恢复电脑hosts文件的方法,感兴趣的话一起来看看吧。
恢复方法
1、在任务栏的搜索框中输入CMD;右键单击命令提示符并选择以管理员身份运行。

2、在用户账户控制界面,选择是。

3、在管理员:命令提示符中输入:
01for /f %P in (dir %windir%\WinSxS\hosts /b /s) do copy %P %windir%\System32\drivers\etc echo %P Notepad %P
4、然后按下回车键(键盘上的Enter按键)。

5、您需要等待一段时间,然后会出现一些提示。(若是hosts文件丢失将会创建,否则将覆盖);然后输入:a ;然后按下回车键(键盘上的Enter按键)。

6、然后,打开hosts文件并关闭它。
