16 lines
711 B
Plaintext
16 lines
711 B
Plaintext
' 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, fso, root, ps1
|
|
Set sh = CreateObject("WScript.Shell")
|
|
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
|
|
' 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
|