title: MsBuild run Exec for every item in a list
body: <p>I'm trying to load a list of filenames from a text file and then run an Exec task for each entry retrieved from the text file.</p>
  
  <p>So I have a file, let's call it SomeFile.txt containing the following:</p>
  
  <pre><code>FileA.file
  FileB.file
  FileC.file
  </code></pre>
  
  <p>The MsBuild code I have for this looks like this (which doesn't work:)</p>
  
  <pre><code>&lt;Target Name="runScripts"&gt;  
  
      &lt;ItemGroup&gt;
          &lt;scriptsFile Include="SomeFile.txt" /&gt;
      &lt;/ItemGroup&gt;        
  
      &lt;ReadLinesFromFile File="@(scriptsFile)"&gt;
          &lt;Output TaskParameter="Lines" ItemName="scriptItems" /&gt;
      &lt;/ReadLinesFromFile&gt;
  
      &lt;Message Text="Running Exec for each entry..." /&gt;           
      &lt;Exec Command="$(someCommand) %(scriptItems)" /&gt;
  
  &lt;/Target&gt;
  </code></pre>
  
  <p>This gives me an error saying I need to specify an item name, but if I use anything like %(scriptItems.item) or %(itemname.scriptItems) MsBuild simply puts a blank instead of %(scriptItems).  </p>