Reputation: 793
Is there a way that whenever I compile my project in Visual Studio it will create the exe file in the project directory and also copy the exe file to a different directory?
Is Visual using a makefile that I can edit and add the copying command to it? Thanks!
Upvotes: 1
Views: 788
Reputation: 38919
You'll want to open up your Project Properties (just select the project and press Alt + Enter)
From there go to: "Configuration Properties" > "Build Events" > "Post-Build Event" and edit the "Command Line" property:
There you'll what to use the
$(Target Path)
macro to get the generated executable. So you're "Command Line" property will probably look something like this:
mkdir "Lorem Ipsum"
copy "$(Target Path)" "Lorem Ipsum"
Incidentally this can also be accomplished in an AfterBuildEvent
In you .vcprojx file. If you're interested you can read more here: MSBuild AfterBuild Step
Upvotes: 2