# Executing console commands at game start?

**URL:** <https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 23, 2014, 3:46pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070 "2014-03-23T15:46:50Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjiko99](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Benjiko99](https://forums.unrealengine.com/u/Benjiko99)\
**Post date:** [March 23, 2014, 3:46pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/1 "2014-03-23T15:46:50Z")

</div>

Where can i write commands to be executed at when the game starts? For example set the FOV to 110.

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [March 23, 2014, 3:48pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/2 "2014-03-23T15:48:19Z")

</div>

Create an Event Begin Play node in the level blueprint and attach it to Execute Console Command.

---

<div class="post-metadata">

**Author:** ![Benjiko99](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Benjiko99](https://forums.unrealengine.com/u/Benjiko99)\
**Post date:** [March 23, 2014, 4:03pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/3 "2014-03-23T16:03:07Z")

</div>

Thanks, that works but isnt there a config file where i could do this either?

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [March 23, 2014, 4:36pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/4 "2014-03-23T16:36:31Z")

</div>

If you want to change the player camera’s FOV permanently you can set that in your player camera blueprint. You cant set it in an .ini file and you dont need coding for this.

---

<div class="post-metadata">

**Author:** ![MadHoundGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/madhoundgames/32/88709_2.png) [@MadHoundGames](https://forums.unrealengine.com/u/MadHoundGames)\
**Post date:** [March 24, 2014, 1:59pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/5 "2014-03-24T13:59:45Z")

</div>

Open this address your browser. C:\Program Files\Unreal Engine\4.0\Engine\Config  
Double click BaseInput.ini

Search for  
ConsoleKey=

Assign a key for use. I use upper left corner key on my keyboard which TILDE but you know.

In editor start a game, Press your key…

example  
ConsoleKey="  
ConsoleKey=P  
ConsoleKey=O

---

<div class="post-metadata">

**Author:** ![Benjiko99](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Benjiko99](https://forums.unrealengine.com/u/Benjiko99)\
**Post date:** [March 24, 2014, 3:10pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/6 "2014-03-24T15:10:04Z")

</div>

Thanks but thats not what i wanted. I wanted the commands to execture automatically when the game loads. Jacky’s solution works fine.

---

<div class="post-metadata">

**Author:** ![senpusha\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@senpusha\_1](https://forums.unrealengine.com/u/senpusha_1)\
**Post date:** [August 15, 2014, 9:46am UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/7 "2014-08-15T09:46:25Z")

</div>

This was really helpful, thanks.

Here is a screenshot:

![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/d/cd0608021ddd49f6edb1974745362e1c2cd8b7f7.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_eb7b8f5e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_eb7b8f5e](https://forums.unrealengine.com/u/anonymous_user_eb7b8f5e)\
**Post date:** [October 13, 2014, 2:05pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/8 "2014-10-13T14:05:23Z")

</div>

This does not work in HTML5. I get a “Command not recognized: stat XXX”, which works just fine in Editor. Is there anything we need to do to activate the stats in HTML5?

---

<div class="post-metadata">

**Author:** ![Jacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacky/32/918690_2.png) [@Jacky](https://forums.unrealengine.com/u/Jacky)\
**Post date:** [October 13, 2014, 9:25pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/9 "2014-10-13T21:25:55Z")

</div>

Is it only happening with that command or any command you try to execute via blueprints?

---

<div class="post-metadata">

**Author:** ![joeGraf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@joeGraf](https://forums.unrealengine.com/u/joeGraf)\
**Post date:** [May 16, 2017, 12:41am UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/10 "2017-05-16T00:41:55Z")

</div>

There are 2 ways to do this from the command line. -exec= which is a list of commands to run. -ExecCmds=command 1,command 2, etc…

---

<div class="post-metadata">

**Author:** ![Max\_Pixel\_FFL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Max\_Pixel\_FFL](https://forums.unrealengine.com/u/Max_Pixel_FFL)\
**Post date:** [July 19, 2019, 11:28pm UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/11 "2019-07-19T23:28:25Z")

</div>

Which is it? `-exec=` or `-ExecCmds=`?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8dbf0370](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8dbf0370](https://forums.unrealengine.com/u/anonymous_user_8dbf0370)\
**Post date:** [September 27, 2019, 6:57am UTC](https://forums.unrealengine.com/t/executing-console-commands-at-game-start/278070/12 "2019-09-27T06:57:51Z")

</div>

I tried the following  
-ExecCmds=“stat unit, stat memory”  
and it works.
