codex - 💡(How to fix) Fix Open in VS Code silently fails on Windows when VS Code is configured to run as administrator [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19800Fetched 2026-04-28 06:36:56
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2

Error Message

Clicking “Open in VS Code” from the project header does nothing. No toast, dialog, or visible error is shown. 8. Check the Codex desktop logs and observe an EACCES error when spawning Code.exe.

RAW_BUFFERClick to expand / collapse

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

Codex App 26.422.3464.0 codex-cli 0.121.0

What subscription do you have?

Pro

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

Environment:

  • Windows
  • Codex desktop app
  • VS Code installed at user-level path: C:\Users\user\AppData\Local\Programs\Microsoft VS Code\Code.exe

Observed: Clicking “Open in VS Code” from the project header does nothing. No toast, dialog, or visible error is shown.

Log:

spawn C:\Users\user\AppData\Local\Programs\Microsoft VS Code\Code.exe EACCES


### What steps can reproduce the bug?

1. On Windows, install VS Code in the default user-level location:
   `C:\Users\<user>\AppData\Local\Programs\Microsoft VS Code\Code.exe`

2. Open the VS Code executable properties.

3. Enable:
   Compatibility > Run this program as an administrator

4. Start the Codex desktop app normally, not as administrator.

5. Open any project in Codex.

6. Click the “Open in VS Code” button in the project header.

7. Observe that nothing visible happens in the UI.

8. Check the Codex desktop logs and observe an `EACCES` error when spawning `Code.exe`.

In my case, disabling “Run this program as an administrator” on VS Code immediately fixed the issue.

### What is the expected behavior?

Codex should not fail silently when “Open in VS Code” cannot launch VS Code.

Expected behavior:
- If launching VS Code succeeds, open the project in VS Code.
- If launching VS Code fails with `EACCES`, show a visible toast/dialog explaining that Windows denied launching VS Code.
- The message should suggest checking whether VS Code is configured to run as administrator, or whether Codex and VS Code are running with mismatched privilege levels.

Example message:
“Could not open VS Code. Windows denied the launch request. VS Code may be configured to always run as administrator. Disable ‘Run this program as an administrator’ for VS Code, or run Codex with matching privileges.”


### Additional information

This was local-machine specific. The same Codex workflow worked on another laptop.

VS Code itself was installed correctly:
- `code` was available on PATH.
- `vscode://` protocol was registered.
- Running `code <project-path>` manually from PowerShell opened the project successfully.

The issue was only with Codex launching VS Code from the desktop app button while VS Code was configured to always run as administrator.

extent analysis

TL;DR

Disabling "Run this program as an administrator" for VS Code or running Codex with matching privileges is likely to fix the issue.

Guidance

  • The EACCES error suggests a permissions issue when Codex tries to spawn VS Code, likely due to the administrator privileges setting.
  • To verify, check if disabling "Run this program as an administrator" for VS Code resolves the issue.
  • If the problem persists, try running Codex with administrator privileges to see if it makes a difference.
  • Consider adding a check in Codex to detect and handle the EACCES error, providing a user-friendly error message as described in the expected behavior.

Example

No code snippet is provided as the issue seems to be related to configuration and permissions rather than code.

Notes

The issue appears to be specific to the local machine configuration, as it worked on another laptop. Ensuring consistent privileges between Codex and VS Code is key.

Recommendation

Apply workaround: Disable "Run this program as an administrator" for VS Code, as it directly addresses the identified cause of the issue and is a straightforward configuration change.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING