# How to run any console command in C++?

**URL:** <https://forums.unrealengine.com/t/how-to-run-any-console-command-in-c/716509>\
**Category:** C++\
**Tags:** unreal-engine, Rendering, packaging-projects, Blueprint, CPP\
**Created:** [November 27, 2022, 9:30pm UTC](https://forums.unrealengine.com/t/how-to-run-any-console-command-in-c/716509 "2022-11-27T21:30:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [November 27, 2022, 9:43pm UTC](https://forums.unrealengine.com/t/how-to-run-any-console-command-in-c/716509/2 "2022-11-27T21:43:49Z")

</div>

> [@Run console command via C++?](https://forums.unrealengine.com/t/run-console-command-via-c/3942/2):
>
> 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/how-to-run-any-console-command-in-c/716509)._
