Dos命令设置固定IP和设置IP自动获取

# 设置固定IP、子网掩码、默认网关、DNS

@echo off
netsh interface ip set address "无线网络连接" static 172.20.10.8 255.255.255.240 172.20.10.1
netsh interface ip set dns "无线网络连接" static 172.20.10.1
netsh interface ip add dns "无线网络连接" 8.8.8.8
pause

# 设置IP、子网掩码、默认网关、DNS自动获取

@echo off
netsh interface ip set address name="无线网络连接" source=dhcp
netsh interface ip set dns name="无线网络连接" source=dhcp
pause

你可能感兴趣的:(Dos)