Launch external program

Hey Guys,

I wanted to create a blueprint which launches an an external program. Right now I’ve written the C++ code to create the blueprint, but I can’t seem to launch an external program. It’s not giving an error, it just does nothing. For test I’ve created a .txt file on my F drive and this is the code I’ve got so far.

Headerfile

#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "LaunchExternalProgram.generated.h"

/**
 * 
 */
UCLASS()
class SERELLYN_LIBRARY_1_API ULaunchExternalProgram : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

		UFUNCTION(BlueprintCallable, meta = (DisplayName = "Launch External Program", CompactNodeTitle = "ExtProgram"), Category = "Core Functions")
		static void LaunchExternalProgram();
	
};

CPPfile

#include "Serellyn_Library_1.h"
#include "LaunchExternalProgram.h"

void ULaunchExternalProgram::LaunchExternalProgram() {
	FPlatformProcess::CreateProc(TEXT("F:\\test.txt"), nullptr, true, false, false, nullptr, 0, nullptr, nullptr);
}

I hope someone can show me what i’m doing wrong.

Thank you!

Anyone? I could really use some help.

Hey i was with the same problem, used you code and tryed to make it work. I found a solution in your .CPP

#include <Windows.h>
#include "Serellyn_Library_1.h"
#include "LaunchExternalProgram.h"

void UBlueprintCPP::LaunchExternalProgram() {

	system("F:\\test.txt");
}

i don’t know if it is the best way, but worked for me.