首页 > 代码库 > IP地址切换脚本

IP地址切换脚本

https://mikebeach.org/2012/05/02/how-to-script-a-change-to-a-static-ip-address-or-dhcp-ip-address-in-windows/

 
netsh interface ipv4 set address name="Local Area Connection" static 10.145.1.249 255.255.255.0 10.145.1.4
netsh interface ip set dns "Local Area Connection" static 10.145.1.34 10.150.0.9
 
 
netsh interface ipv4 set address name="Local Area Connection" source=dhcp
netsh interface ipv4 set dnsservers name="Local Area Connection" source=dhcp

IP地址切换脚本