cmd 脚本修改网卡dns

  

 

复制代码
@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
复制代码

 

posted @   ascertain  阅读(363)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示