Compile solution using Command Line

Hi! I want to compile my solution with command line, without open VS. after several attempts, I tried to run the command located in the “Build Command Line " section inside the property of the solution: — “D:\Program Files\UE4_4.23.1\Engine\Build\BatchFiles\Build.bat” -Target=“mygame_testEditor Win64 DebugGame -Project=”$(SolutionDir)$(ProjectName).uproject”" -Target=“ShaderCompileWorker Win64 Development” -WaitMutex -FromMsBuild —

but, when I run the command, I got an error: ERROR: Couldn’t find target rules file for target ‘DebugGame -WaitMutex -FromMsBuild’ in rules assembly ‘UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’.
Location: D:\Program Files\UE4_4.23.1\Engine\Intermediate\Build\BuildRules\UE4Rules.dll
Target rules found:

if I use this with only one target, it works fine ( only my solution, or only ShaderCompileWorker ), how can I compile both files with only one command? is it possible replicate the command that VS use? or am I missing a settings?

P.S. I have VS 19, UE 4.23

You don’t need Visual Studio generator if you don’t like it, there are plenty of other generators available.

to name a few:
VCProjectFileGenerator,
VCMacProjectFileGenerator,
VSCodeProjectFileGenerator,
MakefileGenerator,
CMakefileGenerator,
QMakefileGenerator,
CLionGenerator,
XcodeProjectFileGenerator,
RiderProjectFileGenerator,
CodeLiteGenerator,
KDevelopGenerator,
ModuleConfiguration,
EddieProjectFileGenerator,

As you can see for your case I would choose either makefile, CMake generator or VS Code. to avoid project files and build on command line (at least it looks like that’s what you want)
To actually generate your preffered build files you need to define it’s properties (elements) in **BuildConfiguration.xml **and then run GenerateProjectFiles.bat

Here is a reference you need for start:
https://docs.unrealengine.com/en-US/…ion/index.html

Because you do need a generator, that is you need to generate those files which contain those rules, just choose what kind of project generation you want and make a setup. running a command just like that is not how you build projects, unless you write your target and build.cs and source code manually in some editor, which is a horrible thing to attempt.