Batch file variables initialized in a for loop

For the record, the corrected script looks like this:

setlocal ENABLEDELAYEDEXPANSION

for %%f in (%MYTARGETDIR%\*config.xml) do (

  SET TMPFILE=%%F.tmp

  echo In loop !TMPFILE!
)

echo End loop %TMPFILE%

Thanks chris for your help.

Leave a Comment