|I'm not with you on the hash. As to SORT, to sort on 4th char in filename:|
dir/b | sort /+4
As to sending them to different folders, you can easily get the 4th char of filename with substring handling.
For your files where all have 4 digit names like xxxx.ext where x is a number:
:: get fourth char of filename
@echo off > newfile & setLocal EnableDelayedExpansion
for /f "tokens=* delims=" %%a in ('dir/b/a-d') do (
If at first you don't succeed, you're about average.