代码比较简单
pinger.bat-
- @echo off
- for /f "skip=1 tokens=1,2,3,4 delims= " %%a in (
- 'wmic path win32_pingstatus where "address='%1'" get protocoladdress^,buffersize^,responsetime^,responsetimetolive'
- ) do (
- set temp_=%%c
- if defined temp_ (
- echo.&echo.Pinging %1 with %%a bytes of data:
- echo.&echo.Reply from %%b Bytes=%%a Time=%%c TTL=%%d
- ) else (
- echo.&echo.Ping request could not find host %1.Please check the name and try again.
- )
- )
- exit /b
复制代码
|