将电脑DNS改成谷歌DNS批处理
@echo off
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit)
set DNS1=8.8.8.8
set DNS2=8.8.4.4
echo change DNS1 to %DNS1%
echo change DNS2 to %DNS2%
echo =========== START ============
for /f "tokens=1,2,3* skip=3" %%i in ('netsh int show interface') do (
netsh interface ipv4 add dns "%%l" %DNS1% index=1 > nul
netsh interface ipv4 add dns "%%l" %DNS2% index=2 > nul
echo "%%l" change complete!!
)
ipconfig /flushdns > nul
echo =========== COMPLETED ============
pause