Open cmd.exe window in UE4 C++

Hello Community!

I’m having a hard time trying to get a command prompt window to open. I’ve tried the following:



void ATestCommander::BeginPlay()
{
Super::BeginPlay();

FProcHandle WorkHandle = FPlatformProcess::CreateProc(TEXT("C:\\Windows\\System32\\cmd.exe"), nullptr, true, false, false, nullptr, 0, nullptr, nullptr);

if (WorkHandle.IsValid())
{
UE_LOG(LogTemp, Warning, TEXT("I DID IT!"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("DANG!"));
}

}


and I’ve tried



// Called when the game starts or when spawned
void ATestCommander::BeginPlay()
{
Super::BeginPlay();


bool bWorked = FPlatformProcess::ExecProcess(TEXT("C:\\Windows\\System32\\cmd.exe"), nullptr, false, false, false);

if (bWorked)
{
UE_LOG(LogTemp, Warning, TEXT("I DID IT!"));
}
else
{
UE_LOG(LogTemp, Warning, TEXT("DANG!"));
}

}


Both of them do return true with their conditions. I’ve tried other applications and they indeed do open just fine. Just Command Prompt seems to not open at all through UE4.

Is there something I need to do to open the command prompt in Windows?