Мой вариант
Код:
@echo off
setlocal
pushd "C:\test"
for /f %%i in ('dir /b') do set "ext_%%~xi=%%~xi"
for /f "tokens=2 delims==" %%i in ('set ext_') do call:1 "%%i"
popd
goto:eof
:1
for %%i in (*%~1) do if not defined min (set min=%%~ni) else (set max=%%~ni)
for /l %%i in (%min%,1,%max%) do if not exist %%i%~1 echo %%i%~1
for %%i in (min max) do set "%%i="