切换IP批处理文件

来贵州出差啦,需要在宾馆,政府的内网和外网不断的切换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

你可能感兴趣的:(批处理)