title: Reading property file in windows batch with repeating values for a key
body: <p>My first attempt to automate some directory creation using a windows batch.</p>
  
  <p>I have file that looks like this:</p>
  
  <pre><code>app=application
  proj=project
  file=file1.txt
  file2.txt
  file3.txt
  app=application2
  proj=project2
  file=file1.txt
  file2.txt
  file3.txt
  </code></pre>
  
  <p>I want to read the file so that for each app and project combination, I want to create some directories and copy the files.</p>
  
  <p>Such that in the end I have something like this:</p>
  
  <ul>
  <li>C:\application\project\file1.txt</li>
  <li>C:\application\project\file2.txt</li>
  <li>C:\application\project\file3.txt</li>
  <li>C:\application2\project\file1.txt</li>
  <li>C:\application2\project\file2.txt</li>
  <li>C:\application2\project\file3.txt
  and so on..</li>
  </ul>
  
  <p>I think I can figure out how to create the directory if I can somehow read the content of the property file in the right order.</p>
  
  <p>I tried this, but I am not getting the expected results:</p>
  
  <pre><code>@echo off
  For /F "tokens=1,* delims== " %%A IN (tempForBatch.txt) DO (
  IF "%%A"=="app"  set app=%%B
      echo "App is %app%"
  
  IF "%%A"=="proj" set proj=%%B
      echo "Proj is %proj%"
  
  
  IF "%%A"=="file"  set file=%%B
  echo "File is %file%"
  )
  </code></pre>
  
  <p>But I get this instead:
      "App is application"
      "Proj is project"
      "File is file1.txt"
      "App is application"
      "Proj is project"
      "File is file1.txt"
      "App is application"
      "Proj is project"
      "File is file1.txt"
      "App is application"
      "Proj is project"
      "File is file1.txt"
      "App is application"
      "Proj is project"
      "File is file1.txt"</p>
  
  <p>Any idea how I can achieve this?</p>
  
  <p>Thanks for taking the time in advance.</p>