You need to start Windows Command Prompt
Then go to the drive UE5 is installed on, for me it was G
Typed g:
Then go to the directory where UnrealBuildTool.exe is located.
cd YourInstallFolder\Engine\Binaries\DotNET\UnrealBuildTool
Then run the UBT
UnrealBuildTool.exe -projectfiles -project=“C:\UnrealProjects\ProjectFolder\ProjectName.uproject” -game -engine -rocket -progress