Skip to content

[Bug]: Windows installer-created scheduled task launches gateway.cmd with visible console — should use windowless launcher #89231

Description

@CameronWeller

Summary

On Windows, the OpenClaw scheduled task OpenClaw Gateway (created at install time and bound to LogonTrigger) runs gateway.cmd directly. Because the action is cmd.exe → node.exe, a visible cmd.exe console window appears on the desktop on every launch — at logon, after watchdog-driven recovery, after manual schtasks /run, etc.

Setting Settings.Hidden = True on the task does not fix this. That flag only hides the task entry from the Task Scheduler MMC list; it does NOT suppress the console window of cmd.exe started by the action.

Repro

  1. Install OpenClaw on Windows 11 (verified on build 10.0.26200).
  2. Confirm the OpenClaw Gateway scheduled task action is gateway.cmd (the installer default).
  3. Stop the running gateway: Stop-Process -Name node -Force
  4. Watchdog (or LogonTrigger after a reboot) relaunches the task → a cmd.exe window visibly appears on the desktop.

Expected

Background launch is invisible. The gateway is a service-class background process — it should never produce a visible console window on user-driven restart, logon trigger, or watchdog-driven recovery.

Actual

A cmd.exe window pops up on every relaunch. Users either mentally filter it or accidentally close it (which kills the gateway, as I just did).

Workaround

Wrap gateway.cmd in a windowless launcher and point the task at that instead:

' run-gateway-hidden.vbs
Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd.exe /c ""C:\Users\<user>\.openclaw\gateway.cmd""", 0, False

Then set the task action to:

wscript.exe "C:\Users\<user>\.openclaw\run-gateway-hidden.vbs"

wscript.exe is windowless by design (canonical Windows pattern for truly-hidden launches). After applying this and a clean recycle, no console appears on any future launch path. Verified locally.

Suggested fix

The installer's Windows scheduled-task creation step should either ship a VBS/JS launcher (small, no deps), use SW_HIDE/START /B semantics, or compile a tiny windowless .exe wrapper. Pointing the task action at gateway.cmd directly is the root cause.

Related

Environment

  • Windows 11 Pro 10.0.26200
  • OpenClaw 2026.5.28
  • node v24.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions