自动更改网络配置的bat文件

      由于在公司使用无线,回家没有无线路由。而又要把笔记本的网络通过无线共享给iTouch上网 。所以要经常更换无线网卡ip的配置(在公司自动获取ip,在家要手动配置 )。所以在网上搜索相关信息,根据自己实际情况稍做修改。如下是使用的bat文件。

 

HomeIP.bat

 

netsh interface ip delete dns "Wireless Network Connection" addr=all
netsh interface ip add dns "Wireless Network Connection" addr=192.168.0.1
netsh interface ip add address "Wireless Network Connection" 192.168.0.1 255.255.255.0
ipconfig /flushdns

 

CompIP.bat

 

netsh interface ip delete dns "Wireless Network Connection" addr=all
netsh interface ip set address name="Wireless Network Connection" source=dhcp
ipconfig /flushdns

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