@echo off for %%f in (1 1 %~1) do >>"file_%%f.txt" (for /l %%s in (1 1 %%f) do @echo [%%s] Str) exit /b