CODE: [Copy to clipboard]@echo off for /f "delims=. tokens=1*" %%a in ('dir /b *.bat *.exe') do ( ren %%a.%%b %%a%%b.txt )