title: Running .bat file from TeamCity
body: <p>How can I automate executing a batch file from TeamCity. Can I create a TC build configuration and have the TC agent build that and automatically run the specified batch file?</p>
  
  <p>EDIT: batch script.</p>
  
  <pre><code>echo off
  
  echo Do you want to deploy xxxx to DerServ(yn): 
  set /p input=
  
  if "%input%" == "y" goto :1
  if NOT "%input%" == "y" goto :2
  
  :1
  SET MSBUILD="C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
  %MSBUILD% xxxxx.defaultTeamCity.msbuild /target:projBuild
  
  goto end
   :2
  ECHO Exiting...
  goto end
   :end   
  
   pause
  </code></pre>
  
  <p>Error message:</p>
  
  <blockquote>
    <p>[12:25:12]: 'projBuild' is not recognized as an internal or external command,[12:25:12]: operable program or batch file.[12:25:13]: Build finished</p>
  </blockquote>