Codex Windows App fails to start: bundled Codex CLI binary exists but cannot be executed
Open 💬 10 comments Opened Aug 26, 2026 by ChanghaoLiao
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
26.820.7780.0
What subscription do you have?
ChatGPT Pro
What platform is your computer?
Windows 11 Home China, OS Build 26200, 64-bit (x64)
What issue are you seeing?
The Codex Windows App fails to start with the following error:
ChatGPT failed to start. Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
However, the Codex CLI binary is present inside the installed application package.
I located the following binaries:
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\Codex.exe
C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\resources\codex.exe
I then manually set CODEX_CLI_PATH to the bundled CLI:
$env:CODEX_CLI_PATH="C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\resources\codex.exe"
When attempting to execute it:
& $env:CODEX_CLI_PATH --version
PowerShell returns:
程序“codex.exe”无法运行: 拒绝访问。
CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
FullyQualifiedErrorId : NativeCommandFailed
The Chinese error message means that codex.exe cannot be executed because access is denied.
Therefore, the bundled CLI binary appears to exist, but the Codex App cannot locate or execute it successfully.
What steps can reproduce the bug?
- Install or update the Codex Windows App to version
26.820.7780.0. - Launch the Codex App.
- The app fails to start and displays:
Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
- Open PowerShell and locate the bundled CLI:
$pkg = Get-AppxPackage OpenAI.Codex
Get-ChildItem $pkg.InstallLocation -Recurse -Filter "codex.exe" -ErrorAction SilentlyContinue | Select-Object FullName
- Observe that
app\resources\codex.exeexists. - Set
CODEX_CLI_PATHto that executable. - Run:
& $env:CODEX_CLI_PATH --version
- PowerShell returns an
Access deniederror and the executable cannot be launched.
I have not modified the permissions or ACLs under C:\Program Files\WindowsApps.
What is the expected behavior?
_No response_
Additional information
_No response_
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
$p=Join-Path (Get-AppxPackage OpenAI.Codex).InstallLocation "app\resources\codex.exe";[Environment]::SetEnvironmentVariable("CODEX_CLI_PATH",$p,"User");$env:CODEX_CLI_PATH=$p 使用这个命令,在powershell里执行,然后重启chatGPT就行了
Additional reproduction + confirmed workaround on Windows Store/MSIX build
OpenAI.Codex 26.820.7780.0:Reproduction details
The bundled files are present in the package, including:
Both of these return
TruewithTest-Path:However, attempting to execute the bundled Windows CLI directly fails:
with:
(
Access denied.)Also, no usable per-user relocated CLI was present under either:
CODEX_CLI_PATHwas initially unset, and no WSL-relatedrunCodexInWindowsSubsystemForLinuxsetting was found in the user config/state files checked.Confirmed workaround
I installed the standalone Codex CLI through npm:
This installed
codex-cli 0.149.1.I then located the native Windows executable inside the npm package (not the
codex.cmdwrapper), e.g.:The native executable runs correctly:
Then I set the user environment variable:
After restarting Windows, the ChatGPT/Codex desktop app starts normally again.
This suggests the packaged CLI is present but unusable from the Store/MSIX location on this system, while a normal unprotected native
codex.exeworks immediately when explicitly supplied viaCODEX_CLI_PATH.I did not modify ownership, ACLs, or permissions under
C:\Program Files\WindowsApps.I maintain WinBridge Recovery: https://github.com/zemeng5208/winbridge-recovery
This report is close to the local Windows repair layer WinBridge is intended to diagnose, specifically the gap between the protected MSIX/WindowsApps resources and the per-user relocated runtime under
%LOCALAPPDATA%\OpenAI\Codex\bin.In this case, the important signal is not only that
app\resources\codex.exeexists, but that it cannot be executed directly from the protected package location and there is no usable relocated per-user CLI. WinBridge can help inspect whether the current install has:binmaterialization,.staging-*relocation state,It does not modify
WindowsApps, take ownership of package files, or bypass package protection. It also cannot guarantee a fix: if26.820.7780.0is using a relocation/copy path that is intrinsically incompatible with the protected package resources on this Windows configuration, the durable fix needs to be in Codex's Windows relocation logic rather than in local state repair.Also, setting
CODEX_CLI_PATHdirectly to the protectedWindowsAppscopy may still fail withAccess denied, as this issue already demonstrates. A useful distinction is whether a verified unprotected per-user copy can be materialized from the currently installed official package; that separates local staging failure from a higher-level startup-path bug.I also have this issue now
I could open it just fine yesterday, but today I can't open it at all, and uninstalling and reinstalling doesn't work either.Unable to locate the Codex CLI binary.Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
I can reproduce this on a newer build: 26.820.9563.0.
One additional detail: the standalone CLI workaround does NOT fully resolve the issue on my machine.
I installed the official standalone Codex CLI successfully:
codex-cli 0.150.1
Path:
C:\Users\<USER>\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
I then set the user-level CODEX_CLI_PATH to this native codex.exe and rebooted Windows.
After that, the original "Unable to locate the Codex CLI binary" dialog disappeared, but the desktop app still does not create a GUI window.
Multiple ChatGPT.exe processes remain running in the background, but all have:
MainWindowHandle = 0
MainWindowTitle = empty
No codex.exe child process is launched.
The desktop log stops after only:
Launching app
Appshot hotkey inactive
I also performed a complete uninstall, verified that both the AppX package and LocalAppData package directory were removed, rebooted, and reinstalled from Microsoft Store.
The newly installed version is still 26.820.9563.0, and the bundled app\resources\codex.exe is again marked:
Archive, Encrypted
Attempting to copy that bundled executable fails with:
"The specified file could not be encrypted."
So in my case there appear to be two stages:
the same issue
Update: the issue is still reproducible after updating to Codex App 26.820.9563.0.
CODEX_CLI_PATH is unset.
The bundled CLI exists:
Test-Path $cli
=> True
But executing:
& $cli --version
still fails with:
Access denied
FullyQualifiedErrorId: NativeCommandFailed
So the issue persists in 26.820.9563.0.
Follow-up after updating the Windows desktop app to
26.820.9563.0:The original bundled-CLI problem was already worked around by keeping
CODEX_CLI_PATHpointed to a working standalone native Codex CLI installed via npm (codex-cli 0.149.1). After the desktop app updated to26.820.9563.0, a second failure mode appeared.New symptom on 26.820.9563.0
Launching the app created multiple
ChatGPT.exeprocesses, but no GUI window appeared. Diagnostics showed:for every
ChatGPT.exeprocess. One process reached roughly 400+ MB working set and ~58 threads, so the process tree itself was alive rather than immediately crashing. Nocodex.exechild process was present during the headless period.Thread inspection did not show
WaitReason=Suspended, soNtResumeProcesswas not the relevant workaround here.I also tested disabling the updater path:
and launched the app inside the MSIX package context with
Invoke-CommandInDesktopPackage. The variable was confirmed active; the startup log showed:and then no additional log lines for a prolonged period. The app remained headless with all
MainWindowHandle=0.Recovery behavior observed
After leaving the headless process tree running instead of killing/relaunching it repeatedly, the GUI eventually appeared on its own after a long initial wait.
Crucially, after the first successful launch completed, I exited the app normally and launched it again. The second launch completed in under 6 seconds.
So on this system the practical sequence was:
26.820.7780.0: bundledcodex.exeexists but is not executable from WindowsApps (Access denied).CODEX_CLI_PATHto the native npmcodex.exe; desktop app becomes usable.26.820.9563.0: app initially becomes headless (ChatGPT.exeprocesses alive, everyMainWindowHandle=0, no GUI).CODEX_SPARKLE_ENABLED=falseis active, but the first post-update startup still stalls for a long time.This looks consistent with the reports where
26.820.9563.0experiences an abnormally long first-start/bootstrap stall after update, after which subsequent launches become normal again.Current workaround state retained on this machine:
No ownership/ACL changes were made under
C:\Program Files\WindowsApps.