Problems with FOR...DO and filename output

November 15, 2010 at 09:45:24
Specs: Windows XP
I've got a long batch file but I can break down the issue to this very command and it's special behavior.

Why does

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

give me back all Filenames while

For %%X In ("*.TXT") Do (
echo %%X > LISTOFFILES.log
)

just writes ONE filename in the LISTOFFILES.log file?

any information appreciated.

chris


See More: Problems with FOR...DO and filename output

Report •

#1
November 15, 2010 at 09:51:40
With a single > it overwrites.

try >>


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

M2


Report •

#2
November 15, 2010 at 10:23:24
that's the solution. thanks a lot!

Report •
Related Solutions


Ask Question