Ну, положим.
Powershell
Код:
![Выделить весь код](images/misc/selectcode.png)
$pdfs = dir "C:\temp\from\*.pdf"
$folders = dir "C:\temp\to" -directory
$folders |% {
$pdfs |? name -match $_.name |mv -Destination $_.fullname
}
Создание тестовых файлов и папок
Код:
![Выделить весь код](images/misc/selectcode.png)
@("23452"
"45487"
"23455"
"65434"
) |% {mkdir "C:\temp\to\$_" -ErrorAction SilentlyContinue > $null}
@("23452F"
"DEG23452"
"45487B"
"23455F1"
"65434B2"
"62434B2"
) |% {New-Item "C:\temp\from\$_.pdf" -ErrorAction SilentlyContinue > $null}