@echo off echo a:设置ip和dns为自动获取 echo b:设置静态ip和dns set /p var=选择a或b: if%var%==a ( netsh interface ip set address 无线网络连接 source=dhcp netsh interface ip set dns 无线网络连接 source=dhcp ) if%var%==b ( netsh interface ip set address 无线网络连接 static 11.3.91.253255.255.255.011.3.91.1 netsh interface ip set dns 无线网络连接 static 10.78.173.10 ) pause