这个批处理文件
@echo off
set path=C:\Users\ssiyengar\Desktop\Pingtest\pinglist.csv
set file=C:\Users\ssiyengar\Desktop\Pingtest\temp.txt
set qosping=1
cls
for /f "tokens=1-3 delims=," %%a IN (%path%) do (
ping %%c -n %qosping% > %file%
findstr "time< time=" %file% >nul
if %errorlevel%==1 (
echo %%a %%b IP %%c Ping FAILURE
) else (
echo %%a %%b IP %%c Ping SUCCESS
)
)
pause
Run Code Online (Sandbox Code Playgroud)
输出:
'ping' is not recognized as an internal or external command,
operable program or batch file.
'findstr' is not recognized as an internal or external command,
operable …Run Code Online (Sandbox Code Playgroud)