title: Correct syntax to copy and overwrite a file in a post build event
body: <p>What is the best way to copy and always overwrite a file to the target directory in a postbuild event in VS2010 running on windows 7.</p>
  
  <p>At the moment I am using </p>
  
  <pre><code>robocopy $(SolutionDir) $(TargetDir) "Morning Report Template.xlsm"
  </code></pre>
  
  <p>I have also tried using Xcopy (with /Y) and even just plain copy. But I have not made it work properly yet. Either I get build errors like "The command "robocopy C:\Working\Projects\SAFEXQueryForm\ C:\Working\Projects\SAFEXQueryForm\SAFEXQueryForm\bin\Release\ "Morning Report Template.xlsm"" exited with code 1." Or else it just doesn't copy.</p>
  
  <p>I need it to copy and overwrite everytime, without build errors and I would also prefer to change the file name which I know Robocopy can't do.</p>
  
  <p>What am I doing wrong? And what is the best way to do this?</p>