一、静态地址设置
如:ip:192.168.21.93,子网掩码:255.255.255.0,网关:192.168.21.254,DNS:202.115.32.36
@echo off
echo "开始配置..."
netsh interface ipv4 set address name="本地连接" static 192.168.21.93 255.255.255.0 192.168.21.254
netsh interface ipv4 set dnsservers name="本地连接" static 202.115.32.36 primary
echo "完成配置..."
pause
二、DHCP方式设置
@echo off
echo "开始配置..."
netsh interface ipv4 set address name="本地连接" dhcp
netsh interface ipv4 set dnsservers name="本地连接" dhcp
echo "完成配置..."
pause