I think you've made the script overly complicated. Try this:
for /L %%C in (1,1,31) do (
for /r %1 %%D in ("Folder\Day_%%C.txt") do echo %%D
A couple of notes:
Batch treats all variables as strings except when using set /a.
for /L will do the counting for you, no need to do extra addition.
It's easy to confuse the double percent syntax (
%%C) required for the
for loop with the single percent syntax (
%1) used to access arguments passed to the script from the command line. Just be aware that command line args only use the single percent syntax.
I'm not sure what you second
for loop is supposed to be doing. You needed another loop variable there (
%%D) for it to work. I suspect you're trying to output the lines of the file Day_1.txt, Day_2.txt, etc., but I don't think it's going to work the way it's currently written, especially if you need to create the file first.
Edit in response to comment attached to evianton's answer:
You didn't specify that you needed 2-digit days in your original question. The code below (modified from evianton) should solve that issue.
for /l %%C in (1,1,31) do (
if %%C lss 10 set num=0%%C
echo. >> "Folder\Day_!num!.txt"