|I’m looking for a way to shift files into folders automatically by creating them.|
So the Output ought to be-
1. The numbers are 9 characters in length, most of them, some are longer and some shorter. So I’ll need variables
2. There can be other files than .jpg’s too.
3.Folders will keep varying, so I’ll need to know what to alter for Input and output.
4. Please make it as universal as possible so that other users can also benefit from this question
Win 7 32bit
What I found is this
But it does not work and gives only output of a folder called “!dirname!” but nothing in it. Found at
for /f "tokens=*" %%1 in ('dir /a-d /b c:\files\*.jpg') do (
set filename=%%1&set dirname=!filename:~0,7!
if not exist c:\files\!dirname! (md c:\files\!dirname!)
copy %%1 c:\files\!dirname!\>nul
Much thanks in advance. I’ll keep giving feedback as I test.