I'm trying to create a task whereby when one application is closed, another is automatically closed.
For instance, I'm using the Atom.io text editor with the Kite plugin (code AI assistant) on Windows 10.
When I open Atom, kited.exe
auto-starts, however when I close Atom, Kite remains running in the background. It consumes a non-trivial amount of CPU and memory so I'd like to have it automatically shut down when I close Atom.
My thought process is to approach this as a scheduled task that triggers on an event. The event trigger is closing Atom. The task is running a PowerShell script to shut down the Kite: stop-process -name kited
This question is very similar to Trigger a PowerShell Script from a Windows Event however I've looked through the Event Viewer and there does not appear to be a recorded Event ID of when third-party apps are initiated/terminated.
In summary - I'm asking for help with defining this event (closing Atom) such that it triggers the PowerShell command stop-process -name kited
.
Also open to completely alternative approaches to get the job done. I just want Kite to close when I close Atom.
start /wait <PATH_TO_ATOM>
and see that the cmd prompt hangs until it exits. If it does, this will work without a more creative solution.