I am trying to use for loop in CMD to 1) obtain user input as a number 2) use that number to create "n" number of .txt files starting from 1.txt and ending at n.txt.
I have this so far:
@echo off
set /p n="Enter a number:"
for %%n%% in (1, 1, %%n%%) echo %%n%% > %%n%%.txt
I played around with the "%" since it is in a batch file. If I just use this:
@echo off
set /p n="Enter a number:"
echo %n% was created
It will says "input" was created , if I add the "> %n%.txt" then it will create a file called n.txt with whatever the echo line says inside the .txt file and does not echo the result on the cmd screen.
Keep in mind that I am new to this, been playing with this particular challenge question for a few days and to no avail.
Any input is appreciated!