|@echo off & setlocal enabledelayedexpansion|
for %%a in (*.pdf) do (
rem move %%a !z!\||md !z!&&goto :1
echo move %%a !z!\
::=== end batch, not tested, safety is ON, remove "rem" to arm the weapon.
If the subdir does not exist, batch attempts to create one. If perchance a file exists that has the subdir name, theoretically the MD should fail and the batch skips to the next PDF.
Forfiles or powershell are better options overall.
message edited by nbrane