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.
At the moment I am using
robocopy $(SolutionDir) $(TargetDir) "Morning Report Template.xlsm"
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.
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.
What am I doing wrong? And what is the best way to do this?