In the project properties of Visual Studio, you will have the option "Pre-Build Event" and "Post-Build Event".
At these configurations you can input programs that should be executed before and after your build. You can use project variables to identify your solution folder, project folder, binary, etc. If you are using a recent version of Visual Studio, there is a button below the text box that give you access to those variables.
Make sure that whatever you call at this configuration would be executed from the shell environment (cmd
), otherwise you will receive a build error. Scripts will probably required that you input a call to the interpreter and pass the file as a parameter.
For example, let's say I need to run a Python script before I build my code. I would configure the Pre-Build Event as:
c:\python\python myscript.py
One good advice is to use DOS Batch files (.bat) to wrap around whatever you need to run and add those to your build events. There are plenty of tutorials over the net on how to create bat files, and they are fairly simple.