S
stanps
Can someone PLEASE tell me why the following 'for loop' only processes
the last character of the group?
for %%a in (j r) do (
echo %%a
if /i "%%a"=="r" (set thisdir=c:\Windows)
if /i "%%a"=="j" (set thisdir=c:\temp)
)
This will always return with %thisdir% = c:\Windows
If I make 'j' the last character in the group, it will always return
%thisdir% = c:\temp.
Please note: I can see it step through the loop using echo commands,
however the thisdir variable is only set at the end. Just cut and
paste it and run it, and you'll see what I'm talking about.
Thank you VERY much, in advance!
Stan
the last character of the group?
for %%a in (j r) do (
echo %%a
if /i "%%a"=="r" (set thisdir=c:\Windows)
if /i "%%a"=="j" (set thisdir=c:\temp)
)
This will always return with %thisdir% = c:\Windows
If I make 'j' the last character in the group, it will always return
%thisdir% = c:\temp.
Please note: I can see it step through the loop using echo commands,
however the thisdir variable is only set at the end. Just cut and
paste it and run it, and you'll see what I'm talking about.
Thank you VERY much, in advance!
Stan