To create your files in a different directory, add the path of your choice, just before the name of your new files.
If you are unsure, here’s what that would look like:
FOR /L %A IN (1 1 10) DO (echo. > “C:\Users\\Desktop\File %A.txt”)
Replace with your computers username.
Also, if you are planning on running any of these commands from a batch script you need to use two percentage signs instead of one, so that they are interpreted correctly.
Named Files (First, Second, Third):
Creating named files or, multiple files with different, specified names is quite similar.
Here is what that would look like:
FOR %A IN ("First", "Second", “Third”) DO (echo. > %A.txt)
The above command will create three files in your current directory with the following names: First.txt, Second.txt, Third.txt.
To make this command work for you, replace the names you want your files to have in the first parenthesis. And if necessary, replace, or adjust the second parenthesis with the command that will create your files the way you require.
The number of files that will be created depends entirely on how many file names you feed into the loop.