@echo off
set ex=.txt
cd/d "e:\test"
set "dd=f:\new"
if not exist "%dd%" md "%dd%"
for /d %%i in (*) do (
for /f %%j in ('dir/b/a-d/od *%ex%') do echo;%%i\%%j&set "fn=%%j"
call copy "%%i\%%fn%%" "%dd%\%%i%ex%">nul
call echo %%i\%%fn%% =^^^> %%i%ex%
)
pause