- @echo off
- Setlocal enabledelayedexpansion
- for /f "delims=" %%m in ('dir /b *.txt') do (
- for /f "delims=" %%i in (%%m) do (
- call,set t=%%i
- call,echo %%t: =%%>>temp
- )
- for /f "tokens=1,3 delims=:" %%i in ('findstr /n . temp ^|find "IPv4地址" ^|find "首选"') do (
- set IP=%%j
- echo IP地址:!IP:~,-4!>>result.txt
- set /a a=%%i-4
- for /f "tokens=1,3 delims=:" %%a in ('findstr /N . temp ^|findstr /b "!a!"') do (echo MCA地址:%%b>>result.txt)
-
- )
- del temp /q
- )
- echo 操作成功完成 查看result文件
- start result.txt
- pause>nul
复制代码
|