0

I have this script and two files, a.txt, b.txt

for %%f in (*.txt) do (
    echo 1 > c.txt
    echo %%f
)

but this for loop also loop the file created after the script

how to limit it only loop the files before running script?

CL So
  • 3,455
  • 9
  • 44
  • 93
  • 3
    `for /f "delims=" %%f in ('dir /a-d /b *.txt') do ...` enumerates the files before it does the first `do`. – Stephan Feb 08 '22 at 18:19

0 Answers0