title: Windows batch comma delimited list in for loop
body: <p>I know there are a lot of related questions on SO, like <a href="https://stackoverflow.com/questions/17158719/how-to-loop-through-comma-separated-string-in-batch">this one</a> or <a href="https://stackoverflow.com/questions/2112694/how-do-i-get-a-for-loop-to-work-with-a-comma-delimited-string">this one</a>, but for some reason I couldn't get any of those working so far. </p>
  
  <p>I am trying to create a batch file to install several pieces of software in a row : </p>
  
  <p>Here is my batch file </p>
  
  <pre><code>set packages=(7zip.install, ^ :: for compression
  notepadplusplus.install, ^ :: file editor
  Firefox, ^
  putty, ^
  mysql -Version 5.5.30, ^
  postgresql)
  
  for %%i in %packages% do ( 
  ::echo %%i
  cinst %%i
  )
  </code></pre>
  
  <p>Everything works fine but for the mysql part. The space is actually taken as a delimiter, which means that I get </p>
  
  <pre><code>E:\&gt;(echo 7zip.install )
  7zip.install
  
  E:\&gt;(echo notepadplusplus.install )
  notepadplusplus.install
  
  E:\&gt;(echo Firefox )
  Firefox
  
  E:\&gt;(echo putty )
  putty
  
  E:\&gt;(echo mysql )
  mysql
  
  E:\&gt;(echo -Version )
  -Version
  
  E:\&gt;(echo 5.5.30 )
  5.5.30
  
  E:\&gt;(echo postgresql )
  postgresql
  </code></pre>
  
  <p>What I would like to end up with is </p>
  
  <pre><code>E:\&gt;(echo mysql -Version 5.5.30 )
   mysql -Version 5.5.30
  </code></pre>
  
  <p>The trick is that I want to keep my list on top of the script with one element per line, and have the possibility to insert a comment to be clear about what happens.</p>
  
  <p>Is there any way to do this? </p>
  
  <p>I am way more used to linux bash, and I must say I am a bit lost with the windows notations. </p>
  
  <p>Thanks!</p>