title: How to run executable file after TFS Build
body: <p>My task is:</p>
  
  <p>after TFS build</p>
  
  <p>1) On a server X stop file Example.exe</p>
  
  <p>2) Copy files from Drop Location into server X</p>
  
  <p>3) Run a brand-new version of Example.exe on a server X</p>
  
  <p>I'm updating DefaultTemplate.xaml in TFS 2012, Visual Studio 2012.
  I'm entering InvokeProcess activity that runs Do.bat script.</p>
  
  <p>My Build Agent copies files to server X and then runs file \X...\Do.bat</p>
  
  <p>Do.bat is something like</p>
  
  <pre><code>taskkill /F /IM Example.exe
  start \\%~p0Example.exe
  </code></pre>
  
  <p>So, the problem is the Example.exe is running on a Build Agent, not on server X.</p>
  
  <p>How can I make build agent run an executable file on another server?
  The additional question - is it worth using bat files as scripts in TFS Build?</p>