CODE: [Copy to clipboard]set sname=%~n1 echo %sname% & echo %1 pause >nul ren %1 %~n1 for %%f in (%1) do (copy 1.txt + %%f + 3.txt %%f.htm)