The following may accomplish what you are looking for. It uses a for
loop to iterate through the text files and makes a "call" to another bit of the batch file to do the rename and increment of a variable.
Edit Change math operation to cleaner solution suggested by Andriy.
@echo off
set i=1
for %%f in (*.txt) do call :renameit "%%f"
goto done
:renameit
ren %1 %i%.txt
set /A i+=1
:done
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…