I have a number of SQL scripts in a directory, prefixed with a number, e.g.
Currently, I'm able to loop through them with this script:
@ECHO OFF
FOR /r . %%F IN (*.sql) DO (
ECHO File:"%%F"
)
However, because of the way that Windows reads files in a directory, 10 and 11 are read before 2, etc.:
How can I loop through each file in the directory, in order of the prefix?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…