方法1
以管理员身份运行cmd输入指令
for /f %P in ('dir %windir%\WinSxS\hosts /b /s') do copy %P %windir%\System32\drivers\etc & echo %P & Notepad %P
再输入a
方法2
1创建一个记事本
2打开记事本
3将下列代码复制进去:
@echo off
CLS
:: 以管理员权限运行
%1 mshta vbscript:createobject("shell.application").shellexecute("%~s0","::","","runas",1)(window.close)&exit
cd /d %~dp0
:: 初始化DNS
echo 重置DNS...
:刷新DNS
ipconfig /flushdns
:: 初始化网络代理
echo 重置网络代理设置...
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f >nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f >nul 2>nul
echo 网络代理设置已重置
:: 初始化Hosts文件
@echo off
echo 重置hosts文件...
cd %windir%\system32\drivers\etc
echo # Copyright (c) 1993-2009 Microsoft Corp. > hosts
echo # >> hosts
echo # This is a sample HOSTS file used by Micros