title: Using batch, how would you iterate through an array that you don't know how many values it may contain to run a function on each individual variable
body: <p>I have a batch file creating an array of variables it gets from a textfile, as follows:</p>
  
  <pre><code>for /f "skip=1 tokens=9 delims= " %%a in (%findfile%) do set "_%%a=yes"
  set count = 0
  for /f "tokens=1* delims==#" %%b in ('set _') do (
      set /a count+=1
      set x=%%b
      set location[!count!]=!x:~1!
  )
  set %location%
  </code></pre>
  
  <p>I'm trying to get each variable from the array to be looped into a function individually, but have no idea how to do it!!</p>
  
  <p>The <strong><em>location</em></strong> array storing all the variables has to be called into a for loop and the function I'm trying to get it to loop into is an FFMPEG function:</p>
  
  <pre><code>for %%i in (%location%\*.mp4) do (if not exist "%%~ni\" MD "%%~ni"
  
      ffmpeg -i "%%i" -vframes 1 -f image2 -start_number 0 
      "%%~ni\%%~ni_Summary_%%3d.jpeg"
  
  )
  </code></pre>
  
  <p>All HELP would be greatly appreciated</p>