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=%%i12 if "!LINE:~0,1!" neq " " (13 set NAME=%%i14 ) else (15 echo "!LINE!" | find "%CS_1%" > nul16 if !ERRORLEVEL! equ 0 (17 echo !NAME!18 echo %%i19 )20 )21 )22 pause