I have created a code that takes the following variables:
SET sdir=T:\path\to\in\
SET tempdir=T:\path\to\tempBatch\
SET list=DE NL
Then, I try to loop through the list items and copy all TXT files in them to the tempBatch
folder.
(for %%l in (%list%) do (
set tempINdir=%sdir%%%l
echo %%l
echo %tempINdir%
))
The output I get is:
DE
T:\path\to\in\NL
NL
T:\path\to\in\NL
Of course, I want to have the %%l
variable concatenate with the %sdir%
path:
The output I get is:
DE
T:\path\to\in\DE
NL
T:\path\to\in\NL
Why does it only take the last item in the list when creating tempINdir
? I have tried to use setlocal EnableDelayedExpansion
from this answer, but this doesn't do anything.