# WritePipe does not work with exe process

**URL:** <https://forums.unrealengine.com/t/writepipe-does-not-work-with-exe-process/473311>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [October 22, 2020, 1:46pm UTC](https://forums.unrealengine.com/t/writepipe-does-not-work-with-exe-process/473311 "2020-10-22T13:46:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisRoto](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ChrisRoto](https://forums.unrealengine.com/u/ChrisRoto)\
**Post date:** [October 22, 2020, 1:46pm UTC](https://forums.unrealengine.com/t/writepipe-does-not-work-with-exe-process/473311/1 "2020-10-22T13:46:34Z")

</div>

I am having trouble with the FPlatformProcess::WritePipe() function.

I have:  
Created a pipe FPlatformProcess::CreatePipe(readPipe, writePipe)  
Created my process PlatformProcess::CreateProc(\*url, \*params, false, false, false, processID, 0, nullptr, writePipe) - Works

I can read from my pipe and get feedback from the exe program: FPlatformProcess::ReadPipe(readPipe) - Works

Every time I write with the WritePipe() function it returns **true** , but It does not reflect on the exe.  
FString\* out = new FString();  
if (!FPlatformProcess::WritePipe(writePipe, command, out))  
{  
return false;  
}

Has anyone tried using this method before?

Note this exe works with C# StreamWriter.WriteLine(string)

---

<div class="post-metadata">

**Author:** ![Brent.Tripwire](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brent.tripwire/32/726046_2.png) [@Brent.Tripwire](https://forums.unrealengine.com/u/Brent.Tripwire)\
**Post date:** [July 6, 2023, 10:16pm UTC](https://forums.unrealengine.com/t/writepipe-does-not-work-with-exe-process/473311/2 "2023-07-06T22:16:56Z")

</div>

You’re probably well past this by now but I was having the same issue (so this is for others facing this issue). I decided to read the [Microsoft docs](https://learn.microsoft.com/en-us/windows/win32/procthread/creating-a-child-process-with-redirected-input-and-output), since the underlying code is just calling the Windows API (on windows).

I was able to get this working by following the standard Windows API:

```auto
// Handles
void* StdOutReadHandle = nullptr;
void* StdOutWriteHandle = nullptr;
void* StdInReadHandle = nullptr;
void* StdInWriteHandle = nullptr;

// In/Out pipes
FPlatformProcess::CreatePipe(StdOutReadHandle, StdOutWriteHandle);
FPlatformProcess::CreatePipe(StdInReadHandle, StdInWriteHandle, true);

FProcHandle ProcHandle = FPlatformProcess::CreateProc("path/to/my.exe", "args", true, true, true, nullptr, 0, nullptr, StdOutWriteHandle, StdInReadHandle);

FPlatformProcess::WritePipe(StdInWriteHandle, "Hello, World!");

```

---

<div class="post-metadata">

**Author:** ![Johnny\_6621](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Johnny\_6621](https://forums.unrealengine.com/u/Johnny_6621)\
**Post date:** [December 21, 2024, 6:14am UTC](https://forums.unrealengine.com/t/writepipe-does-not-work-with-exe-process/473311/3 "2024-12-21T06:14:47Z")

</div>

that’s because when you create the pipe, you only create the pipe that transmit data from outer process to UE, but didn’t create a pipe that transmit data from ue to outer process.So you may want to do as Brent do, which is creating another pipe, and give the readHandle to the process when creating it.

---

<div class="post-metadata">

**Author:** ![Johnny\_6621](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Johnny\_6621](https://forums.unrealengine.com/u/Johnny_6621)\
**Post date:** [December 21, 2024, 6:16am UTC](https://forums.unrealengine.com/t/writepipe-does-not-work-with-exe-process/473311/4 "2024-12-21T06:16:29Z")

</div>

but I don’t think the issue has anything to do with Windows underlying code

---

<div class="post-metadata">

**Author:** ![lehuan5062](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lehuan5062](https://forums.unrealengine.com/u/lehuan5062)\
**Post date:** [February 11, 2025, 8:13am UTC](https://forums.unrealengine.com/t/writepipe-does-not-work-with-exe-process/473311/5 "2025-02-11T08:13:30Z")

</div>

I wonder why the second CreatePipe needs bWritePipeLocal = true.
