设置IP:

Echo off 
echo 设置中~
Netsh interface IP Set Addr "WLAN" Static 192.168.0.2 255.255.255.0 192.168.0.1
Pause

Addr “这里写网卡名” Static IP 掩码 网关

设置为dhcp获取IP:

Echo off 
echo 设置中~
netsh interface ip set address name = "WLAN" source = dhcp
Pause

使用方法,右键粘贴,使用编辑器保存为.bat文件即可