Batch File String Concat Issue with FOR...DO

November 15, 2010 at 10:17:18
Specs: Windows XP
Thank you all for supporting this board with your knowledge!

I have 3 text files in my directory. a.txt, b.txt and c.txt

When I run the following code

- - -

For %%X In ("*.TXT") Do (

SET TOTALPARAMETERS=%TOTALPARAMETERS% -file:%%X
)

echo %TOTALPARAMETERS%

- - -

I keep getting "-file:b.txt"

where I expect -file:a.txt -file:b.txt -file:c.txt

It seems there is an issue with the string concatenation?

thank you

chris



See More: Batch File String Concat Issue with FOR...DO

Report •

#1
November 15, 2010 at 11:39:21
Instead of the shotgun approach, take a look at:

set /?
if /?
for /?

and many well written examples on this forum.


=====================================
Life is too important to be taken seriously.

M2


Report •
Related Solutions


Ask Question