首页 > 其他 > 详细

cmd 脚本修改网卡dns

时间:2021-05-07 10:39:45      阅读:9      评论:0      收藏:0      [点我收藏+]

  

 

@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

 

cmd 脚本修改网卡dns

原文:https://www.cnblogs.com/dissipate/p/14737632.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!