# Run console command via C++?

**URL:** <https://forums.unrealengine.com/t/run-console-command-via-c/3942>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [May 7, 2014, 5:41pm UTC](https://forums.unrealengine.com/t/run-console-command-via-c/3942 "2014-05-07T17:41:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![anonymous\_user\_8bc0661f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8bc0661f1](https://forums.unrealengine.com/u/anonymous_user_8bc0661f1)\
**Post date:** [May 7, 2014, 8:19pm UTC](https://forums.unrealengine.com/t/run-console-command-via-c/3942/2 "2014-05-07T20:19:55Z")

</div>

Though we generally try to avoid writing code that relies on executing console commands, you can do it with:

UWorld::Exec(…)

E.g,:

GetWorld()-\>Exec(GetWorld(), TEXT(“MyAwesomeConsoleCommand X Y Z”));

---

_[View the full topic](https://forums.unrealengine.com/t/run-console-command-via-c/3942)._
