Personal web page: Emmanuel Branlard

DOS - Loop through files in alphabetical order

The trick is to use dir /b /on:

for /F "tokens=*" %%f in ('dir /b /on "C:\Dir\*.exe"') do set exe=%%f