how to process file names of a directory in a batch file -


i trying list recent folder in directory not end word 'patch'

for /f "tokens=*" %%a in ('dir /b /od') (             // if loop ensure newest not set ends "-patch". set newest=%%a ) 

for /f "delims=" %%a in ('dir /b /s /o-d /ad ^|findstr /v /e /c:"-patch"  2^>nul') (              set "newest=%%~fa"  goto :break ) :break echo newest : %newest% 

Comments