@echo off :startIP set /p source=STATIC Y or N or E: echo source:%source% if "%source%" == "y" ( goto staticIP ) if "%source%" == "n" ( goto dhcpIP ) if "%source%" == "e" ( goto exitSet ) :staticIP set /p IP=IP: echo IP:%IP% netsh interface ip set address name="本地连接" source=static addr=%IP% mask=255.255.255.0 gateway=192.168.10.1 goto startIP :dhcpIP netsh interface ip set address name="本地连接" source=dhcp goto startIP :exitSet exit @Rem @netsh interface ip set dns name="本地连接" source=static addr=192.168.10.1
啦啦啦