I have several .pdf and .jpg-files that I need to move.
They're named something like this
* being some affix.
Now I want to move these files into folders like this
002\002 - 054\002-054*.pdf 042\042 - 021\042-021*.pdf
Some folders already exists, but in this naming scheme
002\002 - 054 Some Name\
I only want to create the folders as stated in the 2nd code snippet, when they don't already exists. If they already exists, I just want to move the files into the according folder.
Through some googling I was able to put something together
@echo off for %%F in (*.pdf *.jpg) do call :subr "%%F" exit /b :subr set filename=%1 move %1 %filename:~1,3%\%filename:~1,7%\ exit /b
But this doesn't consider the folders that already exist. What would be the best way to accomplish that?