- @echo off
- setlocal ENABLEDELAYEDEXPANSION
-
- for /f "tokens=1-7* delims== " %%a in ('ping www.a.shifen.com ^|findstr /r /c:"时间=[0-9]ms" /c:"时间=[1-9][0-9][0-9]*ms"
- ') do (
- set str=%%g
- set str=!str:ms=!
- if !str! gtr 3 echo.%date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%a %%b %%c %%d=%%e %%f=%%g %%h>>wenti.txt
- if !str! gtr 3 echo.%date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%a %%b %%c %%d=%%e %%f=%%g %%h
- )
-
- pause
复制代码 问题1、就是想一直ping ,加上-t参数之后就运行不了起来了。
问题2、/c:"时间=[1-9][0-9][0-9]*ms "*"是什么意思?搜索大于10毫秒是不是不用“*”号? |