求助 Ping完不通的IP地址找出对应的名字编号- @echo on
- del D:\1\adb\63butong.txt
- del D:\1\adb\63tong.txt
- chcp 437
- goto:63
- set /p temp=:
- if /I "%temp%"=="62" goto :62
- if /I "%temp%"=="63" goto :63
- if /I "%temp%"=="64" goto :64
- if /I "%temp%"=="3" goto :3
- if /I "%temp%"=="4" goto :4
- if /I "%temp%"=="6" goto :6
- if /I "%temp%"=="7" goto :7
- if /I "%temp%"=="5" goto :5
- if /I "%temp%"=="226" goto :226
- if /I "%temp%"=="236" goto :236
- if /I "%temp%"=="230" goto :230
- if /I "%temp%"=="234" goto :234
- if /I "%temp%"=="235" goto :235
- if /I "%temp%"=="229" goto :229
- if /I "%temp%"=="228" goto :228
- if /I "%temp%"=="227" goto :227
- if /I "%temp%"=="231" goto :231
- if /I "%temp%"=="224" goto :224
- if /I "%temp%"=="225" goto :225
- if /I "%temp%"=="238" goto :238
- if /I "%temp%"=="r" goto :r
- :63
- setlocal enabledelayedexpansion
- for /f %%a in (a.txt) do (
- ping -n 1 %%a >pinglog.txt
- For /f "skip=2 tokens=4 delims=: " %%c In ('find "statistics" pinglog.txt') Do set IP=%%c
- For /f "skip=2 tokens=4,7,11 delims=,( " %%j In ('find "Lost" pinglog.txt') Do set Sent=%%j&set Received=%%k&set Lost=%%l
- For /f "skip=2 tokens=3,6,9 delims=, " %%m In ('find "Average" pinglog.txt') Do set Minimum=%%m&set Maximum=%%n&set Average=%%o
- For /f "tokens=3" %%y in ('find /c "Request timed out" pinglog.txt') do set Count=%%y
- if !Count! neq 0 echo TIME OUT IPAddress=!IP! Sent=!Sent! Received=!Received! Lost=!Lost! Minimum=!Minimum! Maximum=!Maximum! Average=!Average >>d:\1\abd\123.txt
- findstr /c:"Destination" pinglog.txt && echo %date%%time% Unreachable IPAddress=!IP! Sent=!Sent! Received=!Received! Lost=!Lost!>>63butong.txt
- findstr /c:"Request" pinglog.txt && echo %date%%time% Unreachable IPAddress=!IP! Sent=!Sent! Received=!Received! Lost=!Lost!>>63butong.txt
- echo, !%%j! >>63butong.txt
- findstr /c:"TTL=" pinglog.txt && echo !IP! >>63tong.txt
- butong
- )
- pause
复制代码
|