.bat file sorting files into folders by name
02:07 09 May 2015

I was wondering if someone could help me edit an answer to the previous question:

.bat file sorting files into folders

I want to do something similar to that code. I want to sort files into folders using a section of the name, except rather than using the last 10 characters I want to use the 10th to the 20th character of the name.

setlocal EnableDelayedExpansion
for %%a in (*.jpg) do (
    set f=%%a
    set g=!f:~0,10!
    md "!g!" 2>nul
    move "%%a" "!g!"
)
file sorting batch-file directory