- Dec
- 40
- 2
for %f in (*.mkv) do (
echo %f >> "E:\Documents\Computer\Files Uploaded.txt"
)
This results in E:\Documents\Computer\Files Uploaded.txt having the following contents:
file1.mkv
file2.mkv
file3.mkv
file4.mkv
file1.mkv
Note that file1.mkv is there twice. After processing everything, the for...do loop "wraps around" back to the beginning. This is a minor annoyance and not a big deal.
However, in other batch files I use, I am doing a lot of other processing and renaming files in a very specific way. When the loop "wraps around" one or more files get processed again and it really screws things up.
As a work-around I include extra code that moves each file out of the directory after it is processed and then moves it back when finished. But that's kind of a pain and shouldn't be necessary.
This happens with TCC versions 24,25 and 26.
echo %f >> "E:\Documents\Computer\Files Uploaded.txt"
)
This results in E:\Documents\Computer\Files Uploaded.txt having the following contents:
file1.mkv
file2.mkv
file3.mkv
file4.mkv
file1.mkv
Note that file1.mkv is there twice. After processing everything, the for...do loop "wraps around" back to the beginning. This is a minor annoyance and not a big deal.
However, in other batch files I use, I am doing a lot of other processing and renaming files in a very specific way. When the loop "wraps around" one or more files get processed again and it really screws things up.
As a work-around I include extra code that moves each file out of the directory after it is processed and then moves it back when finished. But that's kind of a pain and shouldn't be necessary.
This happens with TCC versions 24,25 and 26.
Last edited: