main.bat
1 @echo off 2 color 0a 3 title Get IPv4 Address 2.0 4 5 SETLOCAL ENABLEEXTENSIONS 6 SETLOCAL ENABLEDELAYEDEXPANSION 7 8 set "CS_1=IPv4 Address. . . . . . . . . . . : " 9 10 for /f "tokens=* delims=" %%i in (‘ipconfig‘) do ( 11 set LINE=%%i 12 if "!LINE:~0,1!" neq " " ( 13 set NAME=%%i 14 ) else ( 15 echo "!LINE!" | find "%CS_1%" > nul 16 if !ERRORLEVEL! equ 0 ( 17 echo !NAME! 18 echo %%i 19 ) 20 ) 21 ) 22 pause
原文地址:https://www.cnblogs.com/rms365/p/11240165.html
时间: 2024-11-01 23:18:26