1.无线网络
使用指定ip
@echo off
netsh interface ip set address "无线网络连接" static 192.168.0.111 255.255.255.0 192.168.0.1
netsh interface ip set dns "无线网络连接" static 202.106.0.20 primary
使用自动ip
@echo off
netsh interface ip set address "无线网络连接" source=dhcp
netsh interface ip set dns "无线网络连接" source=dhcp
2.有线网络
使用指定ip
@echo off
netsh interface ip set address "本地连接" static 192.168.0.175 255.255.255.0 192.168.0.1
netsh interface ip set dns "本地连接" static 202.106.0.20 primary
使用自动ip
@echo off
netsh interface ip set address "本地连接" source=dhcp
netsh interface ip set dns "本地连接" source=dhcp