CreateProcessAsUserW failed: 5

Open 💬 1 comment Opened Jun 3, 2026 by jayweinx

What version of the Codex App are you using (From “About Codex” dialog)?

26.601.2237.0

What subscription do you have?

plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Problem

I am using Codex Desktop on Windows with a local workspace:

C:\Users\User\Documents\session

When Codex tries to run any local command, it fails before the command actually runs. The error is:

CreateProcessAsUserW failed: 5

Sometimes the Node-based tool also fails with:

windows sandbox failed: spawn setup refresh
stdout_eof

This happens even with very simple commands such as listing the current directory, for example:

Get-Location
Get-ChildItem -LiteralPath 'C:\Users\User\Documents\session'

So the issue does not seem to be specific to one project folder or one file. It looks like the Windows sandbox / local runner cannot create child processes.

Environment

  • OS: Windows
  • App: Codex Desktop
  • Workspace path: C:\Users\User\Documents\session
  • Filesystem sandbox mode shown in context: workspace-write
  • Permission profile: managed / restricted filesystem
  • Writable root: C:\Users\User\Documents\session

What I was trying to do

I wanted Codex to continue work on a local project:

C:\Users\User\Documents\session\...

The first step was only to confirm that Codex could read the project folder. However, even basic command execution failed before any project files could be read.

What I already tried

  1. Tried a simple PowerShell command:
Get-Location

It failed with:

CreateProcessAsUserW failed: 5
  1. Tried listing the target project folder:
Get-ChildItem -LiteralPath 'C:\Users\User\Documents\session\...'

It failed with the same error:

CreateProcessAsUserW failed: 5
  1. Requested additional filesystem permissions for the project folder:
Read/write:
C:\Users\User\Documents\session\spm_english_pdf_classifier

The permission request was granted, but commands still failed with the same CreateProcessAsUserW failed: 5 error.

  1. Tried the Node REPL / bundled runtime path as an alternative way to read files.

That also failed with:

windows sandbox failed: spawn setup refresh
stdout_eof
  1. Checked whether an app terminal session was attached.

The result was:

No app terminal session is attached to this thread yet.
  1. Tried to request escalated / non-sandbox execution.

That was rejected by the approval policy, so it was not possible to test outside the sandbox.

Question

How should I fix CreateProcessAsUserW failed: 5 on Windows Codex Desktop?

Is there a setting for Windows sandbox mode, such as changing it from default / elevated to unelevated?

If yes, where is that setting located in Codex Desktop?

And after changing it, what is the recommended minimal command to test whether local command execution is working again?





### What steps can reproduce the bug?


```text
Windows Codex Desktop: local commands fail with CreateProcessAsUserW failed: 5

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗