ping带时间戳的ping的cmd命令(保存的文件名添加上时间)

ping带时间戳的ping的cmd命令(保存的文件名添加上时间)

手动输入ip, 带时间戳的ping (txt文件保存在本目录).txt

@echo off  
set /p host1=请输入要ping的目标主机IP地址:  
set logfile=%host1%.txt  
echo 目标主机 = %host1% >%logfile%  
for /f "tokens=*" %%A in ('ping %host1% -n 1 ') do (echo %%A>>%logfile% && GOTO Ping)
:Ping  
for /f "tokens=* skip=2" %%A in ('ping %host1% -n 1 ') do (      
echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A>>%logfile%    
echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A    
findstr /C:"超时" "%host1%.log" > timeout_%logfile%    
findstr /C:"无法" "%host1%.log" >> timeout_%logfile%    
findstr /C:"失败" "%host1%.log" >> timeout_%logfile%    
timeout 1 >NUL      

GOTO Ping)


已经填好的ip,pingTime(txt文件保存在本目录.txt

SET COUNT=0
:LOOP
time /T >>a.txt
ping 172.16.5.132 -l 50000 >>a.txt
GOTO LOOP
:OUT




以管理员的身份此cmd命令:
for /l %i in (1,1,255) do ping 192.168.1.%i -w 1 -n 1 | find "回复" >> d:\ping.txt
其中192.168.1.x:是你局域网地址的ip段。你修改成自己的就行了。
d:\ping.txt:是你保存文档的路径。
将能ping通的保存到桌面的ping.log文件中。


1、本站资源长期持续更新。
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。

转载请保留出处:  www.zh-cjh.com珠海陈坚浩博客 » ping带时间戳的ping的cmd命令(保存的文件名添加上时间)

作者: cjh


手机扫一扫,手机上查看此文章:

一切源于价值!

其他 模板文件不存在: ./template/plugins/comment/pc/index.htm

未雨绸缪、居安思危!

数据安全、有备无患!

注意操作、数据无价!

一切源于价值!