title: How to call msbuild from a batch file from msbuild from team build?
body: <p>I'm using Team Build (2010) to call an msbuild script with an Exec task that calls a batch file that in turn calls msbuild. Like this:</p>
  
  <pre><code>&lt;Exec Command="BatchFileThatCallsMSBuild.bat" /&gt;
  </code></pre>
  
  <p>Of course the batch file does a bunch of other junk or I'd just use the MSBuild task.</p>
  
  <p>The problem is that when the batch file tries to call msbuild it can't find it.</p>
  
  <pre><code>'msbuild' is not recognized as an internal or external command, operable program or batch file.
  </code></pre>
  
  <p>How do I get the necessary environment set up in the exec task?</p>
  
  <p>I tried changing the command to:</p>
  
  <pre><code>&lt;Exec Command="%22$(VS100COMNTOOLS)..\..\VC\vcvarsall.bat%22&amp;amp;BatchFileThatCallsMSBuild.bat" /&gt;
  </code></pre>
  
  <p>but no dice, still msbuild is not found.</p>