@echo offsetlocal enabledelayedexpansionfor /r %%a in (*.txt) do ( set /p Str=<"%%~a" ren "%%~a" "!Str:~,5!%%~xa")pause