I use MS Build this way in batch file, Windows 10, Delphi 10.2.3.
Nice post is here:
http://www.delphifeeds.com/go/s/155085
@ECHO OFF
@SET BDS=C:\Program Files (x86)\Embarcadero\Studio\19.0
@SET BDSINCLUDE=C:\Program Files (x86)\Embarcadero\Studio\19.0\include
@SET BDSCOMMONDIR=C:\Users\Public\Documents\Embarcadero\Studio\19.0
@SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v3.5
@SET FrameworkVersion=v3.5
@SET FrameworkSDKDir=
@SET PATH=%FrameworkDir%;%FrameworkSDKDir%;C:\Program Files (x86)\Embarcadero\Studio\19.0\bin;C:\Program Files (x86)\Embarcadero\Studio\19.0\bin64;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBase2017\IDE_spoof;%PATH%
@SET LANGDIR=EN
@SET BUILD_CONFIG=Release
@SET START_BUILD_STR=Start of building
REM LO_SintPro.dll
REM LO_Slos.dll
@SET LO_Slos="d:\Data Delphi\MyProjects\Dressler\LOCO_upgrade\Loco2\progr_dv_RAD102\DLLs\Lo_Slos\LO_Slos.dproj"
@ECHO %START_BUILD_STR% %LO_Slos%
DEL "d:\Data Delphi\MyProjects\Dressler\LOCO_upgrade\Loco2\progr_dv_RAD102\DLLs\Lo_Slos\LO_Slos.dll"
MSBuild %LO_Slos% -t:clean -p:config=%BUILD_CONFIG% -p:platform=Win32
MSBuild %LO_Slos% -t:Build -p:config=%BUILD_CONFIG% -p:platform=Win32
@ECHO Build %BUILD_CONFIG% done!
pause