zl程序教程

您现在的位置是:首页 >  硬件

当前栏目

cmd 脚本修改网卡dns

网卡 修改 脚本 cmd DNS
2023-09-11 14:16:16 时间

  

 

@echo off

cls

color 0A

chcp 65001

Echo *******************************************************************************

Echo          Collect fault information…………

Echo *******************************************************************************
ipconfig /all > "%userprofile%"\desktop\故障处理.txt
echo. >> "%userprofile%"\desktop\故障处理.txt
echo. >> "%userprofile%"\desktop\故障处理.txt
nslookup -qt=ns 51cjml.com >> "%userprofile%"\desktop\故障处理.txt

Echo *******************************************************************************

Echo          正在修改IP地址和DNS服务器地址,请耐心等待…………

Echo *******************************************************************************

::cmd /c netsh interface ip set address name="本地连接" source=static addr=192.168.1.136 mask=255.255.255.0 gateway=192.168.0.1 gwmetric=1

cmd /c netsh interface ip set dns name="以太网" source=static addr=114.114.114.114

cmd /c netsh interface ip add dns name="以太网" addr=127.0.0.1 index=2

cmd /c netsh interface ip set dns name="本地连接" source=static addr=114.114.114.114

cmd /c netsh interface ip add dns name="本地连接" addr=127.0.0.1 index=2

cmd /c netsh interface ip set dns name="WLAN" source=static addr=8.8.8.8

cmd /c netsh interface ip add dns name="WLAN" addr=127.0.0.1 index=2

ipconfig /all

Echo *******************************************************************************

Echo          OK!!已修改成功!请按任意键继续…………

Echo          超级目录

Echo *******************************************************************************

Pause