How do I compile a Visual Studio project from the command-line?

 Method 1
The first method (which I prefer) is to use msbuild:

Method 2
You can also run:

The vcexpress option returns immediately and does not print any output. I suppose that might be what you want for a script.

Note that DevEnv is not distributed with Visual Studio Express 2008.

So, the end result might be:

You’ll also want to make sure your environment variables are correct, as msbuild and vcexpress are not by default on the system path. Either start the Visual Studio build environment and run your script from there, or modify the paths in Python (with os.putenv).