-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[Bug]: Agent uses CMD syntax (2>nul) in PowerShell on Windows, causing exec errors #10868
Description
Summary
The embedded agent uses CMD-only syntax (2>nul) when executing shell commands, which fails in PowerShell on native Windows. PowerShell
does not recognize nul as a valid redirect target and throws an Out-File / CreateFile error.
Steps to reproduce
- Install OpenClaw natively on Windows via npm install -g openclaw
- Start the gateway (via scheduled task or manually)
- Let the agent execute shell commands such as file listing or
directory browsing
Expected behavior
The agent should detect the current shell environment (PowerShell vs
CMD) and use compatible syntax. For example, 2>$null in PowerShell or
2>nul in CMD.
Actual behavior
The agent unconditionally uses CMD syntax 2>nul in PowerShell,
resulting in the following error:
out-file : FileStream was asked to open a device that was not a file.
For the console, 'com1:' or 'lpt1:', use CreateFile with the
GENERIC_READ
or IntPtr OS handle to create a FileStream around it.
Environment
- Clawdbot version: 2026.2.3-1
- OS: Windows 11 (native, not WSL2)
- Install method: npm (npm install -g openclaw)
Logs or screenshots
[agent/embedded] read tool called without path:
toolCallId=toolu_016FfatyN3aDZuoKk8WqAjD8 argsType=object
[tools] read failed: ENOENT: no such file or directory, access
'C:\Users\seo47.openclaw\workspace\MEMORY.md'
[tools] exec failed: out-file : FileStream was asked to open a device
that was not a file.
For the console, 'com1:' or 'lpt1:', use CreateFile with the
GENERIC_READ
or IntPtr OS handle to create a FileStream around it.
Command: dir /b "C:\Users\seo47.openclaw\workspace\memory" 2>nul
Exit code: 1