|Please test this, change paths to suit your requirements. Also change COPY to Move when you are satisfied that the script does what you want. |
set months=January February March April May June ^
July August September October November December
pushd Path\to\files\||Pushd failed - job terminated.&&exit /b
for /f "tokens=1-3*" %%1 in ('dir /od /tw ^|find "/"') do (
set filedate=%%1&set month=!filedate:~0,2!&set year=!filedate:~-4!
if !month! lss 10 set month=!month:~-1!
set newdir=!temp!\!monthalpha! !year!\
If not exist "!newdir!" md "!newdir!"
echo !file! being copied to !newdir!
COPY "!file!" "!newdir!">nul
for /f "tokens=%month%" %%A in ("!months!") do (
Please come back & tell us if your problem is resolved.