title: Get Web Deploy to run a batch file after publish
body: <p>I'm using Web Deploy to publish a web application from Visual Studio 2012 to my target IIS server. All fine there! </p>
  
  <p>I now want to deploy to multiple servers in a web farm (within a workgroup). I have produced a Robocopy script to copy the files over the network to the other hosts once it has been deployed to the first web server. I can run this bat file manually no problem but I would like to automate it within the deployment process.</p>
  
  <p>So far I've managed to edit the <code>.pubxml</code> file in my VS project as follows.</p>
  
  <pre><code>  &lt;ItemGroup&gt;
      &lt;MsDeploySourceManifest Include="runCommand"&gt;
        &lt;Path&gt;robocopy &amp;quot;c:\web1&amp;quot; &amp;quot;\\REMOTEMACHINE\web1&amp;quot; /MIR&lt;/Path&gt;
      &lt;/MsDeploySourceManifest&gt;
    &lt;/ItemGroup&gt;
  </code></pre>
  
  <p>This runs the command OK but before all files have been synchronised. Also according to the publish log it's running twice. In the middle of the file sync process.</p>
  
  <p>How can I adapt the <code>.pubxml</code> file to run that command only after all files are synchronised?</p>