The following example builds the rebuild target of the MyProject.proj project.
MSBuild.exe MyProject.proj /t:rebuild
You can use MSBuild.exe to perform more complicated builds. For example, you can use it to build specific targets of specific projects in a solution. The following example rebuilds the project NotInSolutionFolder, and cleans the project InSolutionFolder, which is in the NewFolder solution folder.
msbuild SlnFolders.sln /t:NotInSlnfolder:Rebuild;NewFolder\InSolutionFolder:Clean