title: How to make for loop in windows batch file run in name order
body: <p>I have a windows batch file that does this:</p>
  
  <pre><code>for %%s in (*.sql) do call
  
  It loops through all the sql script in a folder.
  
  In the folder the file names are like:
  s4.06.01.sql
  s4.07.01.sql
  s4.08.01.sql
  s4.10.01.sql
  s5.01.sql
  </code></pre>
  
  <p>But the for loop goes through the files randomly (not in the name order), it first run s5.01, then s4.06, then s4.08, then s4.10, then s4.07. How can I make them run in the name order?</p>
  
  <p>It used to work, but now it doesn't. What may cause this problem?</p>