这样行不?
- @echo off
- rem rasphone.pbk不是ANSI格式
-
- set "filename=%allusersprofile%\application data\microsoft\network\connections\pbk\rasphone.pbk"
-
- for /f "tokens=1 delims=:" %%a in ('type "%filename%" ^| findstr /I /N "type=2"') do set /a num=%%a+77
-
- for /f "tokens=2 delims==" %%a in ('more +%num%^<"%filename%" ^| findstr "\<PhoneNumber\>"') do set ip=%%a
-
- echo.IP Address: %ip%
-
- pause
复制代码
|