title: How to loop through array in batch?
body: <p>I created an array like this:</p>
  
  <pre><code>set sources[0]="\\sources\folder1\"
  set sources[1]="\\sources\folder2\"
  set sources[2]="\\sources\folder3\"
  set sources[3]="\\sources\folder4\"
  </code></pre>
  
  <p>Now I want to iterate through this array:</p>
  
  <pre><code>for %%s in (%sources%) do echo %%s
  </code></pre>
  
  <p>It doesn't work! It seems that script is not going into the loop. Why is that? How can I iterate then?</p>