木子屋 Dnawo's BLOG

批处理切换本机IP、网关和DNS

👤 dnawo 📅 2008-09-26 👁 5105 👍 0 💬 0 🔄 本站原创
最近一天到晚机子IP、网关和DNS老要不停的在手工设置和自动获取进行切换,一次次去打开本地连接属性进行设置太麻烦了,查了下dos命令,写两个批处理进行切换:

切换1.bat:
@echo off
netsh interface ip set address "本地连接" static 192.168.0.16 255.255.255.0 192.168.0.254 1
netsh interface ip set dns "本地连接" static 218.85.157.99

切换2.bat:
@echo off
netsh interface ip set address "本地连接" dhcp
netsh interface ip set dns "本地连接" dhcp

评论(0)

暂无评论。

计算题
评论需审核通过后显示
← 上一篇 C#函数ref和out参数的区别 下一篇 → 网摘