用批处理 修改IP 和 DNS 经常在公司和家里两地上网的人试用

           经常在公司和家两地用笔记本上网的人经常会遇到这样的麻烦  公司和家里用的不是一个IP 和DNS   每次手动更改都很麻烦


@echo off 
title IP地址、网关、DNS自动设置程序 

echo 正在更改IP  请稍后...
netsh interface ip set address 本地连接 static 192.168.3.152 255.255.255.0 192.168.3.1  default

echo 正在更改DNS
netsh int ip add dns name="本地连接" addr=202.98.0.68 index=1 
netsh int ip add dns name="本地连接" addr=202.98.5.68 index=2 
exit 

更改IP 后面的default 必须加


 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章