Automate Delphi 2010 project build with MSBuild
You need to switch the parameters. The target parameter (/t) tells MSBuild which target to create. This can be either 'Make', 'Clean' or 'Build' (or a combination of those - seperate them with ';' in this case).
The property parameter (/p) forwards properties to the actual compiler. You can specify for example the configuration using /p:config=
So if you want to clean and then build a project using the release configuration, specify the paramters like this:
msbuild.exe "/t:Clean;Build" "/p:config=Release" Myapp.dproj