zhuyun94822 当前离线
二级士官
zqz0012005 (smile)当前离线
假装是个高手
荣誉版主
netsh interface ip set address name="本地连接" addr=172.24.100.50复制代码
TOP
pusofalse 当前离线
huahua0919 当前离线
五级士官
@echo off&setlocal enabledelayedexpansion set ip1=172.24.100.50 for /f "tokens=2 delims=:" %%i in ('ipconfig^|findstr/i "ip Subnet Gateway"') do ( set /a n+=1 if !n! equ 1 set IP=%%i if !n! equ 2 set Subnet=%%i if !n! equ 3 set Gateway=%%i ) echo 你现在的IP地址为:%ip:~1% echo 子网掩码为:%subnet% echo 默认网关为:%gateway% set/p a=你想修改现在的IP为%ip1%吗?(想Y)(不想N) if/i "%a%"=="y" (netsh int ip set address name="本地连接" static %ip1% %Subnet% %Gateway% 2) else (goto :eof) pause复制代码