skyskiff, попробуйте так:
Код:

@echo off
SetLocal EnableExtensions
set "cod=123456"
set "in=%Userprofile%\Desktop\proba"
for /d %%i in ("%in%") do for /f "tokens=1 delims=%cod%" %%j in ('dir /ad /b "%%~i"') do set "papka=%%j"& call :kopir "%%j"
goto :eof
:kopir
for /f "tokens=1 delims=%cod%" %%k in ('dir /a-d /b "%in%"') do set "file=%%k"& goto ext
:ext
copy "%in%\%cod%%file%.pdf" "%in%\%cod%%papka%\"
exit /b
.