title: Why are files returned by a For Each loop sorted, but not always?
body: <p>I'm not sure if this is the correct place to post this question because I have a hunch that the behavior I witness will also be observed using other methods. But anyway, here it goes.</p>
  
  <p>I have a VBscript that contains code like this:</p>
  
  <p><code>For Each objFile In colFiles<br>
  ...<br>
  Next
  </code></p>
  
  <p>I've been running this code for quite some time on many different systems. I never bothered to order the files alphabetically. But today I found out by accident that the logic of my program depends on it. I ran the code on a new system (under Citrix) and the files were returned in a seemingly random order.</p>
  
  <p>Does anybody know why Windows sometimes returns the files sorted alphabetically while sometimes it doesn't?</p>
  
  <p>Added note: It might be relevant to note that the script as well as the input folder are on a network share (where my script outputs randomly ordered files).</p>