[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
怎么解决的?能告知一下吗?
  1. ping www.a.shifen.com|findstr /r /c:"time=[6-9]ms" /c:"time=[1-9][0-9][0-9]*ms"
  2. pause
复制代码
后面的time=[1-9][0-9][0-9]*ms 这个是搜索什么呢?

TOP

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

TOP

返回列表