@echo off
:start
echo ============请输入数字选择下一步操作:
echo ============1:ip设置为192.168.1.13
echo ============2:设置为DHCP自动获取ip
set /P var=":"
if %var%==1 goto ip250
if %var%==2 goto ipdhcp
:ip250
cls
netsh interface ip set address name="以太网" source=static addr=192.168.1.13 mask=255.255.255.0 gateway=192.168.1.1
echo **IP已设置为192.168.1.13。**
echo ------------------------------------------
goto start
:ipdhcp
cls
netsh interface ip set address name="以太网" source=dhcp
echo **IP已设置为DHCP获取。**
echo ------------------------------------------
goto start
时间: 2024-10-12 12:48:25