title: Batch Scripting - dump msbuild output to a specific file instead of to the console window if successful?
body: <p>I'm not sure how to do this. I have a batch script file I am using to do multiple msbuild calls. I don't want the msbuild output to pollute my command window, but instead I want it to dump into a log file. I'm not sure how to do this, but here's my script so far:</p>
  
  <pre><code>@ECHO Building shared libraries ...
  
  msbuild "SharedLibraries.sln"
  :: Not sure how to catch an unsuccessful build here for my GOTO ERROR?
  :: Copy dll files to specific location
  
  @ECHO Building primary application...
  
  msbuild "Myapp.sln"
  :: Not sure how to catch an unsuccessful build here for my GOTO ERROR?
  
  :ERROR
  </code></pre>
  
  <p>So, how do I:</p>
  
  <ol>
  <li>Dump the msbuild output to a log file?</li>
  <li>Catch unsuccessful builds and go to the error label?</li>
  </ol>