title: Windows Batch loop though variable with dynamic token count
body: <p>In my Windows batch file I have some variable with a various number of strings.
  For exapmle: </p>
  
  <pre><code>set string="-start" "-end someOption" 
  </code></pre>
  
  <p>I count the numbers of a String the following way:</p>
  
  <pre><code>Set count=0
  For %%j in (%string%) Do Set /A count+=1
  echo.Total count: %count%
  </code></pre>
  
  <p>The output would be: </p>
  
  <pre><code>Total count: 2
  </code></pre>
  
  <p>Now I want to start an application as many times as I have Strings in my variable and I want to give the application the current string as parameter. I tried this:</p>
  
  <pre><code> FOR /L %%H IN (1,1,%COUNT%) DO ( 
  
      echo %%H
          FOR /F "tokens=%%H " %%I IN ("%string%") Do (
              echo %%I
              rem java -jar app.jar %%I
          )
      )
  </code></pre>
  
  <p>But unfortunately this does not work: Thats the output:</p>
  
  <blockquote>
    <p>Number of current String: 1 "%H "" kann syntaktisch an dieser Stelle
    nicht verarbeitet werden. (%H "" can not be used syntacticaly at this
    place) Number of current String: 2 "%H "" kann syntaktisch an dieser
    Stelle nicht verarbeitet werden.</p>
  </blockquote>
  
  <p>How can I loop through the two Strings in my variable "string"?</p>