This batch file
@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
outputs:
'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 program or batch file.
SYS1 MC1 IP XX.XX.XX.XX Ping SUCCESS
The CSV file is :
SYS1,MC1,IP1 \
SYS2,MC2,IP2
Why is ping/findstr not recognized?
If I directly pass the values instead of from the CSV file, it works fine. Why? How can I resolve it?
Note: The environment variables already contain the path of Sys32.