title: Use MSDeploy to copy an executable to a server and to then run same
body: <p>I've got MSDeploy/WebDeploy working a treat to update my web applications - this resolves about 90% of my deployment issues for the things I've got set up so far.</p>
  
  <p>What I would like to do, in addition, is to copy an executable - pragmatically the contents of a folder - to the server and then to run that executable (which does schema updates).</p>
  
  <p>I can see that this ought to be possible, but I'm struggling to put the pieces together (this is clearly an edge case).</p>
  
  <p>Specifically:</p>
  
  <ul>
  <li>I'd rather not copy the executable (folder) into the web directory. </li>
  <li>I need to consider the result of running the executable (be useful to return a failure status, though if significant this will get thrown up by post deployment tests)</li>
  </ul>
  
  <p>As much as anything therefore, what specific commands in what order - if I can find a pattern I can make it work but I'm struggling to work out a pattern</p>
  
  <hr>
  
  <p><strong>Notes:</strong></p>
  
  <p>It does occur to me that I could copy the folder to the web directory, run the code and then delete the folder again but I'm uncomfortable with this and in any case it would be better to have the code available on the server post deployment.</p>
  
  <p>Its also worth noting that I am really <em>really</em> happy with the way I maintain database schemas so the fact that that's what the executable is doing is incidental to the question</p>