Get IPv4 Address 2.0

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

附件1

posted @ 2019-07-24 18:49  RMS365  阅读(...)  评论(... 编辑 收藏