Answers
创建一个bat文件(比如 net.bat)来ping外网服务器,请参考以下代码:
@echo off
d:
for /l %%i in (1,1,%999999999%) do (
ping %1baidu.com -n 1% && echo %% >>_ping.txt
date /t >>ping.txt
time /t >>ping.txt
)
pause
或者,简单一点的输出
@echo off
:top
echo %time%>>D:\_ping.txt
ping -n 1 baidu.com | findstr "TTL">>D:\_ping.txt
ping -n 2 127.1 >nul
goto top
然后使用:
start /b net.cmd
来执行(可以使net.cmd在后台执行),输出内容在d盘的_ping.txt中
杨威利元帅
answered 10 years ago