When building a project, all output files are created in one location that is specified from the COBOL properties as Output Path. Is there a way to create the .exe in a different folder leaving all the other generated files in the output path?
It is not possible to have the .exe created in a different folder while the rest of the generated files get created in the output folder. However, a post-build event can be used to have the .exe file to be copied to another folder after a successful build.
Here are the steps to create a post-build event that copies the .exe file to a folder (e.g. C:\Prod) after each successful build:
1. go to project properties
2. click on COBOL properties
3. click on Build Events
4. click on Edit Post-build
5. type copy or xcopy (with a trailing space)
6. click on Macros (to see all possible macro names)
7. double-click on TargetFileName
8. type the target folder to have the following:
xcopy $(TargetFileName) C:\Prod
9. click on OK
10. leave the Run the post-build event drop-down with On successful build
11. click on OK to exit