Replace stale host agent on boot and document one-click Startup install.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-15 18:15:19 -05:00
co-authored by Cursor
parent 840440d7ef
commit df885d5732
5 changed files with 112 additions and 51 deletions
+12 -8
View File
@@ -1,11 +1,15 @@
' Launch the Comfy host agent with no console window.
' Window style 0 = hidden. Wait = True so Task Scheduler keeps the task marked Running.
' Launch the Comfy host agent with no console window (Task Scheduler wait mode).
' Replaces any stale agent on 8199, then runs THIS clone's agent until it exits.
Option Explicit
Dim sh, root, node, agent
Dim sh, fso, root, ps1
Set sh = CreateObject("WScript.Shell")
root = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
root = CreateObject("Scripting.FileSystemObject").GetParentFolderName(root)
node = """C:\Program Files\nodejs\node.exe"""
agent = """" & root & "\scripts\comfy-host-agent.mjs"""
Set fso = CreateObject("Scripting.FileSystemObject")
root = fso.GetParentFolderName(WScript.ScriptFullName)
root = fso.GetParentFolderName(root)
ps1 = root & "\scripts\start-comfy-host-agent.ps1"
If Not fso.FileExists(ps1) Then WScript.Quit 1
sh.CurrentDirectory = root
sh.Run node & " " & agent, 0, True
' Wait=True so Task Scheduler keeps the task marked Running while the agent lives.
sh.Run "powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File """ & ps1 & """ -Wait", 0, True