I have this issue where I want to re-define a variable with each iteration of a for loop. I cannot figure out why this is not working. I have tried messing with enabledelayedexpansion
but have not had success.
echo off
for /f "tokens=1-7 delims=::/ " %%A in ("%DATE% %TIME%") do set capture_time=%%D-%%B-%%C_%%E%%F%%G
for /l %%a in (1,1,3) do (
echo %capture_time%
timeout 3 /nobreak
for /f "tokens=1-7 delims=::/ " %%A in ("%DATE% %TIME%") do set capture_time=%%D-%%B-%%C_%%E%%F%%G
)
My desired output would be something like this:
2015-08-27_132506.50
2015-08-27_132509.50
2015-08-27_132512.50
Where each time the loop is run, the capture_time
is updated.