切換IP批處理檔案

yufeng0471發表於2011-12-01

來貴州出差啦,需要在賓館,政府的內網和外網不斷的切換IP,手動修改的話,非常麻煩,就弄了3個bat批處理檔案,雙擊就可以切換,挺方便的!

 

1:切換手動IP

 

@echo off
netsh interface ipv4 set address "Local Area Connection" static 10.104.100.186 255.255.0.0 10.104.129.1
netsh interface ipv4 set dns name="Local Area Connection" source=static addr=202.98.192.67
 

2:切換自動獲取IP

 

@echo 切換成動態IP地址 
@echo off 
netsh interface ipv4 set address name="Local Area Connection" source=dhcp 
netsh interface ipv4 set dns name="Local Area Connection" source=dhcp

相關文章