echo - Echoing Correct Time in Batch File -
i have problem on computer. time time, features stop working, perhaps 1-5 minutes. ping ceases work when occurs. thought i'd gather stats issue via batch file run ping perhaps 1000 times , echo time when started , again when stopped. file:
echo off set i= /l %%i in (1,1,3) ( echo %time% ping www.google.com echo %time% )
but happens first time echoed same second time. why? or there better way this?
inside command block (surrounded (
parantheses)
), need delayed expansion:
@echo off setlocal enabledelayedexpansion /l %%i in (1,1,3) ( echo !time! ping www.google.com echo !time! )
Comments
Post a Comment