@ECHO Off
SETLOCAL ENABLEDELAYEDEXPANSION
SET "sourcedir=U:\sourcedir"
(
FOR /f %%a IN ('dir /b /a-d "%sourcedir%\*.jpg" ') DO (
SET /a seq=1000000000+%%~na
ECHO !seq!)
)>"%temp%\tempfile"
FOR /f %%a IN ('sort "%temp%\tempfile"') DO (
SET /a seq=%%a-1000000000
ECHO !seq!.jpg)
)
GOTO :EOF
This should work for you - of course, you will need to install your own sourcedir, the temp file name is up to you, it will not be cleared, and it will only work with pure-numerical file names without leading zeros <1000000000 .jpg. An extension is assumed .
source
share