|Lol! Phill22 was right. should have waited for "the other shoe to drop". Oh well, only wasted about 3 minutes on that one anyway. This might work:|
@echo off & setlocal
for /f %%a in ('dir /o-n /b /ad | findstr /r "[0-9][0-9][0-9]"') do set last=%%a & goto :x
:why, in gods green earth, did MS have to make octal have leading zeros!!!!!
:they could have used ANY other friggin thing, but NOOOO! Who the h_ uses
:octal anyway? that went out with 8-bit processors, about 30 years ago.
if %test% equ 0 (
set /a last +=1
i'm sucky with regexp, so that "findstr" might need some tuning.