I\'ve written the following batch file to create multiple files using FOR loop:
@echo off cls FOR /L %%i IN (1 1 10) DO ( echo.> file%%i.txt
I don't know why, but when you write ... IN (*.txt) ...
in the second for
loop, it is trying to find files that are just created within the body of the loop.
To eliminate that, I would make my filter a bit more specific.
FOR %%i IN (file??.txt) DO (
I ran this and it creates only 20 files as expected.