title: How to set array values in a Windows batch file loop?
body: <p>I'm trying to set values in a Windows batch file, it's not working, and I have no idea why.  Here's my code:</p>
  
  <pre><code>@echo off
  setlocal EnableDelayedExpansion
  
  set idx=-1
  set STRING_LIST=
  
  for %%v in (string1 string2 string3) do (
      set /A idx+=1
      echo [!idx!] %%v
  
      set STRING_LIST[!idx!]=%%v
  )
  
  :: Why is my list empty here??
  echo STRING_LIST= %STRING_LIST%
  pause
  </code></pre>
  
  <p>Any help would be greatly appreciated... thanks in advance!</p>