First of all, it's very important to have one-click full build (batch build) of your software product, especially when it is actively develop and/or enter the phase of production.
But it has nothing to do with "CMD". Some confuse CMD with starting application with a command line. No, CMD is a regular application itself, no different from any other. It starts a command-line interpreter, which is irrelevant to your problem. Many other application can start a process via a command line, including the one you can develop. What you really need is one-click object: you click on it, and it build all the project without having to load Visual Studio, that's it. The adequate form of such file could be a batch file of one of the batch types: .bat, .WSF, .ps1 (should better be used with .lnk), .lnk… As the script you would need for this purpose is very simple (see below); all complexity is hidden in your solution and project files, I don't even consider the skills of writing such scripts as programming skills; it's closer to the level of "advanced user".
You can build (this is more precise expression than "compile", because build is what you really do, it can include compilation and many more steps) your project on different levels: by using separate source code files (see Solution 2), by project, by solution.
The most universal approach is the build of whole solution using MSBuild, which is standardized tool using standardized project file format. (You can write custom tasks, custom project types, adapt your own programming languages, and so on.) You can also use MSBuild to build a separate project, which, in your case, will create an output directory and output the build artifact which corresponds to a single output assembly.
MSBuild is what Visual Studio actually use. Please see:
MSBuild[
^],
MSBuild Reference[
^].
But at this moment you only need MSBuild command line:
MSBuild Command-Line Reference[
^].
First, you need to locate the MSBuild.EXE file and write its full path name. This is the example of simple batch:
set build=%windir%\...full-path-name... ...\MSBuild.exe
%build% mySolution.sln
This is a bit more complex example to build the same product in two configurations "Debug", and then "Release"; the output directories are prescribed in each project:
set build=%windir%\...full-path-name... ...\MSBuild.exe
set solution=mySolution.sln
%build% %solution% /p:Configuration=Debug
%build% %solution% /p:Configuration=Release
—SA