Replace stale host agent on boot and document one-click Startup install.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user