改IP地址大家都会,但是说实话,也不轻松,改个IP地址要点很多下。改一次两次没问题,经常需要修改或切换也是件很麻烦的事。这里提供了一个批处理程序,可设置IP地址、子网掩码、网关、DNS,没来得及研究,先放一下。以后可能用得到,用来切换IP地址应该很方便!

@echo off
set/p input=请输入IP地址:
set/p input2=请输入网关地址:
netsh interface ip set address name="本地连接" source=static 192.168.12.%input% 255.255.255.128 192.168.12.126
netsh interface ip set dns "本地连接" static 172.16.0.160 primary
netsh interface ip add dns "本地连接" 192.168.100.250 index=2
netsh interface ip set wins "本地连接" static 172.16.0.160 
netsh interface ip add wins "本地连接" 192.168.100.250 index=2