knmmdb 当前离线
列兵
评分人数
TOP
ygqiang 当前离线
少尉
@echo off set ipqian3=10.9.60 for /f tokens^=1^,2^ delims^=^"^" %%a in ('wmic nicconfig get IPAddress /value ^| findstr /i "IPAddress=[^]"') do (set "ip1=%%b") echo %ip1% echo %ip1% for %%i in (%ip1%) do ( set ipSuffix=%%~xi ) set ipSuffix=%ipSuffix:~1% echo %ipSuffix% set ip=%ipqian3%.%ipSuffix% echo %ip% pause ver|find "5.2" >nul&&goto XP||goto Other :XP echo xp系统修改ip pause netsh interface ip set address "本地连接" static %ip% 255.255.255.0 10.9.60.1 ipconfig/all pause exit :Other echo win7系统修改ip pause netsh interface ipv4 set address "本地连接" static %ip% 255.255.255.0 10.9.60.1 ipconfig/all pause exit复制代码
for /f "tokens=15 delims= " %%i in ('ipconfig ^| find /i "IP Address"') do set i=%%i for /f "tokens=1,2,3,4 delims=." %%i in ("%i%") do (set b=%%i.%%j.%%k.%%l) echo %b% pause复制代码
gawk 当前离线
少将
@echo off for %%i in (192.168.0.15) do ( set ipSuffix=%%~xi ) set ipSuffix=%ipSuffix:~1% echo %ipSuffix% pause复制代码