openclaw - 💡(How to fix) Fix openclaw gateway install 创建的计划任务每次开机弹 CMD 黑窗口

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…
RAW_BUFFERClick to expand / collapse

问题描述

openclaw gateway install 在 Windows 上注册计划任务时,会创建一个每次开机弹出 CMD 控制台窗口的任务。这个窗口无法隐藏,关闭窗口会导致网关停止运行。

环境信息

  • 操作系统:Windows 11 专业版 64-bit
  • OpenClaw 版本:2026.5.9-beta.1
  • Node.js 位于:C:\Program Files\nodejs\node.exe(路径含空格)
  • 主板:ASUS TX GAMING B850M WIFI W
  • CPU:AMD Ryzen 7 9700X

复现步骤

  1. 运行 openclaw gateway install
  2. 重启电脑
  3. 开机后自动弹出 CMD 黑窗口,显示网关运行信息

问题分析

检查已注册的计划任务「OpenClaw Gateway」发现:

  1. 操作执行的是 gateway.cmd 批处理文件

    • 安装程序创建的计划任务执行的是 ~/.openclaw/gateway.cmd
    • Windows 对 .cmd 文件一定会弹出控制台窗口
    • 应直接执行 node.exe 而非通过 .cmd 中转
  2. 登录类型为 Interactive(交互式)

    • 任务以交互式登录运行,窗口直接显示在用户桌面上
    • 后台运行应使用 Password 登录类型
  3. ExecutionTimeLimit 默认为 72 小时

    • 任务运行超过 72 小时后会被自动停止
    • 应默认设为无限制

建议修复方案

openclaw gateway install 创建计划任务时:

  • 直接执行 "C:\Program Files\nodejs\node.exe"(路径含空格需加引号)
  • 参数为 .../dist/index.js gateway --port <port>
  • 使用 Password 登录类型(后台不可见模式)
  • 触发器设为「启动时」(AtStartup)
  • 取消 ExecutionTimeLimit 限制(PT0S)
  • 或提供 --background / --no-window 参数让用户选择

临时解决方法

用户已通过手动修改计划任务解决:

  1. 「操作」改为直接执行 "C:\Program Files\nodejs\node.exe"
  2. 「触发器」改为「启动时」
  3. 「常规」勾选「不管用户是否登录都要运行」
  4. 「设置」取消时间限制

其他信息

  • 卸载重装(gateway uninstall + gateway install)无法解决,因为安装程序走的还是同一套逻辑
  • 手动修改计划任务后可完美后台静默运行,说明核心功能正常,仅安装配置可优化

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

openclaw - 💡(How to fix) Fix openclaw gateway install 创建的计划任务每次开机弹 CMD 黑窗口