Skip to content

fix: prefer .cmd over .ps1 shims on Windows for reliable openclaw CLI execution#7

Merged
damoahdominic merged 1 commit intodamoahdominic:mainfrom
ninjaa:fix/windows-powershell-path
Feb 17, 2026
Merged

fix: prefer .cmd over .ps1 shims on Windows for reliable openclaw CLI execution#7
damoahdominic merged 1 commit intodamoahdominic:mainfrom
ninjaa:fix/windows-powershell-path

Conversation

@ninjaa
Copy link
Copy Markdown

@ninjaa ninjaa commented Feb 17, 2026

When the extension finds openclaw.ps1 (npm global shim) on Windows, PowerShell execution can fail with path errors.

Changes to apps/extension/src/panels/status.ts:

  1. _buildOpenClawInvocation: When a .ps1 path is resolved, checks for a .cmd sibling first and uses it via cmd.exe instead of PowerShell
  2. _runOpenClaw: Added retry — if execution fails and CLI path ends in .ps1, automatically retries with the .cmd sibling

Fixes the error: Command failed: powershell.exe -NoProfile -ExecutionPolicy Bypass -Command & 'C:\Users\...\npm\openclaw.ps1' '--version'

@damoahdominic damoahdominic merged commit 21a6069 into damoahdominic:main Feb 17, 2026
4 checks passed
damoahdominic added a commit that referenced this pull request Mar 16, 2026
fix: prefer .cmd over .ps1 shims on Windows for reliable openclaw CLI execution
damoahdominic added a commit that referenced this pull request Mar 16, 2026
fix: prefer .cmd over .ps1 shims on Windows for reliable openclaw CLI execution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants