codex - 💡(How to fix) Fix Windows desktop shell exposes bundled rg.exe, but executing it fails with Access is denied

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…

Error Message

But any attempt to execute it fails immediately with an access error: Program 'rg.exe' failed to run: An error occurred trying to start process 'C:\Program Files\WindowsApps\OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0\app\resources\rg.exe' with working directory 'C:\code\doc'. Access is denied.

Root Cause

This is especially confusing because the normal agent guidance recommends using rg, and the shell environment makes it look installed and available.

Fix Action

Fix / Workaround

  • PowerShell version: 7.6.0
  • The executable is visible enough for Get-Command and where-style resolution, but not actually launchable.
  • Local workaround on this machine is to avoid rg entirely and use PowerShell-native search (Get-ChildItem, Select-String, Get-Content), but that breaks the expected workflow and tool recommendations.
  • This may be related to the bundled executable living under C:\Program Files\WindowsApps\..., but from the user side the core problem is that Codex exposes a command that cannot be executed.
  • Possibly related to issue #13542, but I am filing a separate report here with full template information and a complete Windows reproduction.

Code Example

Program 'rg.exe' failed to run: An error occurred trying to start process 'C:\Program Files\WindowsApps\OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0\app\resources\rg.exe' with working directory 'C:\code\doc'. Access is denied.

---

Get-Command rg | Format-List Name,CommandType,Source,Path,Version

---

rg --version

---

& 'C:\Program Files\WindowsApps\OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0\app\resources\rg.exe' --version
RAW_BUFFERClick to expand / collapse

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

Observed packaged app version from the resolved bundled executable path: OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0

I could not get a separate value from the Windows package query, but this is the exact bundle path that Get-Command rg resolves to inside the Codex desktop shell.

What subscription do you have?

The local Codex auth configuration is currently in API key mode (auth_mode=apikey). I am not using a separate Codex subscription plan from within the app UI for this repro.

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

Inside the Codex desktop shell on Windows, rg appears to be available, but it is not actually executable.

Get-Command rg succeeds and resolves to the bundled executable: C:\Program Files\WindowsApps\OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0\app\resources\rg.exe

But any attempt to execute it fails immediately with an access error:

Program 'rg.exe' failed to run: An error occurred trying to start process 'C:\Program Files\WindowsApps\OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0\app\resources\rg.exe' with working directory 'C:\code\doc'. Access is denied.

I reproduced the same failure for:

  • rg --version
  • rg --files
  • rg -n -- "--serve" C:\code\doc\script\codex_token_report\codex_token_report.py
  • directly invoking the absolute executable path shown by Get-Command rg

I also reproduced the same failure when running the same command from an escalated shell launched through Codex tooling, so this does not look like a simple non-elevated PATH problem.

This is especially confusing because the normal agent guidance recommends using rg, and the shell environment makes it look installed and available.

What steps can reproduce the bug?

  1. Install and launch the Codex desktop app on Windows.
  2. Open a shell inside the Codex desktop environment.
  3. Run:
    Get-Command rg | Format-List Name,CommandType,Source,Path,Version
  4. Observe that PowerShell resolves rg to: C:\Program Files\WindowsApps\OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0\app\resources\rg.exe
  5. Run:
    rg --version
  6. Observe the command fails immediately with Access is denied.
  7. Run the resolved absolute path directly:
    & 'C:\Program Files\WindowsApps\OpenAI.Codex_26.415.1938.0_x64__2p2nqsd0c76g0\app\resources\rg.exe' --version
  8. Observe the same Access is denied failure.
  9. Repeat from an escalated shell.
  10. Observe the same result.

What is the expected behavior?

If Codex exposes rg on PATH inside its desktop shell, the bundled rg.exe should be executable.

At minimum, one of these should be true:

  • rg runs successfully from the Codex shell on Windows
  • Codex does not put an unusable rg on PATH
  • Codex detects this packaging/permission problem and falls back to another supported search tool

Additional information

  • PowerShell version: 7.6.0
  • The executable is visible enough for Get-Command and where-style resolution, but not actually launchable.
  • Local workaround on this machine is to avoid rg entirely and use PowerShell-native search (Get-ChildItem, Select-String, Get-Content), but that breaks the expected workflow and tool recommendations.
  • This may be related to the bundled executable living under C:\Program Files\WindowsApps\..., but from the user side the core problem is that Codex exposes a command that cannot be executed.
  • Possibly related to issue #13542, but I am filing a separate report here with full template information and a complete Windows reproduction.

extent analysis

TL;DR

The issue can be worked around by using an alternative search tool or modifying the file permissions of the rg.exe executable.

Guidance

  • The error message "Access is denied" suggests a permissions issue with the rg.exe executable, which is located in a protected directory (C:\Program Files\WindowsApps\...).
  • Try running the command prompt or PowerShell as an administrator to see if the issue persists.
  • Consider using an alternative search tool, such as Get-ChildItem and Select-String, as a workaround.
  • If possible, try modifying the file permissions of the rg.exe executable to allow execution.

Example

No code snippet is provided as the issue is related to file permissions and executable location.

Notes

The issue may be related to the fact that the rg.exe executable is bundled with the Codex app and located in a protected directory. Modifying file permissions or using an alternative search tool may resolve the issue.

Recommendation

Apply workaround: Use an alternative search tool, such as Get-ChildItem and Select-String, until the permissions issue is resolved. This will allow you to continue working with the Codex app while avoiding the rg.exe executable.

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

codex - 💡(How to fix) Fix Windows desktop shell exposes bundled rg.exe, but executing it fails with Access is denied