Visual Studio 2008 lets me declare a command and attach it to the post-build event for a project. Like a lot of developers, I use it regularly to xcopy files to the applicat
There is another option: you can separate the commands with &&
.
E.g.
copy $(TargetPath) d:\folder1 && copy $(TargetPath) d:\folder2
This is not exactly the same as separating with newlines: with &&
, if the previous command failed, next commant will not run.
Separating by newlines is easier to read, so you should prefer it. However I know at least one case when &&
is useful. It is the scenario, when you use property sheets to have different post-build steps on different machines. VS 2008 doesn't allow setting PostBuildStep in property sheets directly, but you can add a user macro with your command and call it from the main project settings. A macro is single line, so you can use &&
to have multiple commands there.