# Proper way of using UnrealBuildTool.exe from the command line?

**URL:** <https://forums.unrealengine.com/t/proper-way-of-using-unrealbuildtool-exe-from-the-command-line/279908>\
**Category:** C++\
**Tags:** projects, compiling, unreal-engine, building, UE4, CPP, question\
**Created:** [April 7, 2014, 8:35pm UTC](https://forums.unrealengine.com/t/proper-way-of-using-unrealbuildtool-exe-from-the-command-line/279908 "2014-04-07T20:35:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andargor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andargor](https://forums.unrealengine.com/u/Andargor)\
**Post date:** [April 7, 2014, 8:35pm UTC](https://forums.unrealengine.com/t/proper-way-of-using-unrealbuildtool-exe-from-the-command-line/279908/1 "2014-04-07T20:35:58Z")

</div>

I am trying to use this command from the command line (tweaked from what I see in the editor, with one option off):

“C:\Program Files\Unreal Engine\4.0\Engine\Binaries\DotNET\UnrealBuildTool.exe” MyProject5 -ModuleWithSuffix MyProject5 9024 Win64 Development -editorrecompile “C:\dev\Unreal\Projects\MyProject5\MyProject5.uproject”

I am getting these errors:

Could not parse Engine Version from ObjectVersion.cpp: Could not find a part of the path ‘C:\Program Files\Unreal Engine\4.0\Engine\Source\Runtime\Core\Private\UObject\ObjectVersion.cpp’.  
ERROR: Couldn’t find module rules file for module ‘MCPP’.

What would be the correct command line?

---

<div class="post-metadata">

**Author:** ![Chris528](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris528](https://forums.unrealengine.com/u/Chris528)\
**Post date:** [April 7, 2014, 9:17pm UTC](https://forums.unrealengine.com/t/proper-way-of-using-unrealbuildtool-exe-from-the-command-line/279908/2 "2014-04-07T21:17:08Z")

</div>

You could make a batch file like this

```
call "C:\Program Files\Unreal Engine\4.0\Engine\Build\BatchFiles\Build.bat" MyProject5Editor Win64 Development "C:\dev\Unreal\Projects\MyProject5\MyProject5.uproject"
PAUSE

```

Btw, why does it look like you are building from what looks like a directory from the installed version of unreal 4? Did you drag and drop the github stuff directly into your unreal 4 install or something? I’m pretty sure that’s not how it’s supposed to be done.

---

<div class="post-metadata">

**Author:** ![Andargor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andargor](https://forums.unrealengine.com/u/Andargor)\
**Post date:** [April 7, 2014, 9:23pm UTC](https://forums.unrealengine.com/t/proper-way-of-using-unrealbuildtool-exe-from-the-command-line/279908/3 "2014-04-07T21:23:01Z")

</div>

I get the same error:

Could not parse Engine Version from ObjectVersion.cpp: Could not find a part of the path ‘C:\Program Files\Unreal Engine\4.0\Engine\Source\Runtime\Core\Private  
UObject\ObjectVersion.cpp’.  
ERROR: Couldn’t find module rules file for module ‘MCPP’.

The command line is pulled from the editor Output log (see attached)

 ![3441-2014-04-07_1720.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/c/1acbee2e619548c11635735d7f57997cb4f35365.png)

As for the directory, it is where I installed the binary package, although I do have the sources elsewhere.

---

<div class="post-metadata">

**Author:** ![Chris528](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chris528](https://forums.unrealengine.com/u/Chris528)\
**Post date:** [April 7, 2014, 9:30pm UTC](https://forums.unrealengine.com/t/proper-way-of-using-unrealbuildtool-exe-from-the-command-line/279908/4 "2014-04-07T21:30:40Z")

</div>

What exactly are you trying to do?  
If your point was to compile the engine, editor, etc, then you shouldn’t be using the installed version for this.  
This vid might be of some help. [- YouTube](http://youtu.be/usjlNHPn-jo)

---

<div class="post-metadata">

**Author:** ![Andargor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andargor](https://forums.unrealengine.com/u/Andargor)\
**Post date:** [April 7, 2014, 9:45pm UTC](https://forums.unrealengine.com/t/proper-way-of-using-unrealbuildtool-exe-from-the-command-line/279908/5 "2014-04-07T21:45:59Z")

</div>

I am trying to compile a project without the -FailIfGeneratedCodeChanges flag from the command line using the binaries.

---

<div class="post-metadata">

**Author:** ![Andargor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andargor](https://forums.unrealengine.com/u/Andargor)\
**Post date:** [April 10, 2014, 8:19pm UTC](https://forums.unrealengine.com/t/proper-way-of-using-unrealbuildtool-exe-from-the-command-line/279908/6 "2014-04-10T20:19:10Z")

</div>

I’ve resolved my issue. Although not exactly what I was looking for I’ll accept the answer

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_24cff47d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_24cff47d](https://forums.unrealengine.com/u/anonymous_user_24cff47d)\
**Post date:** [January 30, 2018, 4:38am UTC](https://forums.unrealengine.com/t/proper-way-of-using-unrealbuildtool-exe-from-the-command-line/279908/7 "2018-01-30T04:38:39Z")

</div>

This worked in my case:

```
"path\to\BatchFiles\Build.bat" "MyUProjectEditor" Win64 Development -WarningsAsErrors "path\to\MyUProject.uproject"

```

Note that you have to attach “Editor” suffix to first argument. The build.bat available in BatchFiles folder calles UnrealHeaderTool. Arguments must be in this exact order.
