I'm currently writing a batch files that records the ping of an ip and records the time. Unfortunately when i try to use the %time% command and store it, it always returns nothing.
when i run the command alone it works, just not with my other code
Set packet=0
Set Down=0
Set Up=0
Set time=0
SET /P IP=enter ip.
set counter=0
:ping
Rem ping -n 1 -w 2500 %IP%>>ping.txt
ping -n 1 -w 2500 %IP% > nul 2>&1 && set Test=Pass || set Test=Fail
FOR /F "tokens=1-9 delims==< " %%a IN ('PING -n 1 -w 2500 %IP%') DO IF "%%h"=="TTL" SET RESPONSE=%%g
mode 100
Set time= %TIME:~0,5%
echo %time%
pause