for /f "tokens=*" %%f in ('dir /b *.txt') do (echo %%~nf>temp.temptype "%%f">>temp.tempdel "%%f"ren temp.temp "%%f")