I'm trying to open a number of files in Chrome, in the order they appear in the folder. So far, I've managed to open them in Chrome but in a random order, and echo the file names in the correct order.
@echo off
set args1=%1
for /f "tokens=*" %%s in ('dir /b %args1%\* ^| sort') do start C:\"Program Files"\Google\Chrome\Application\chrome.exe file:///Z:/son/%args1%/%%s
Gives me the former result, which is close, but I really need them in the correct order.
@echo off
set args1=%1
for /f "tokens=*" %%s in ('dir /b %args1%\* ^| sort') do echo %%s
Gives me the filenames in the desired order.
What gives? Isn't it logical that they should therefore open in alphabetical order?
@echo off
set args1=%1
for /f "tokens=*" %%s in ('dir %args1%\* /b /ON') do start C:\"Program Files"\Google\Chrome\Application\chrome.exe file:///Z:/son/%args1%/%%s
Did not work either. Maybe it's Chrome?