A program I wrote, farmComm, may solve this. I released it as open-source and Public Domain.
If it doesn't meet your criteria, you may be able to easily alter it to do so.
farmComm:
- Runs at boot-up under a service, which continues when users log in or out.
- In Session 0
- Under the user "NT AUTHORITY\SYSTEM."
- Spawns arbitrary processes (you choose);
- Also in Session 0
- "Invisibly," or without showing any user interface/GUI
- With access to graphics hardware (e.g. GPUs).
- Responds to the active session, even if it changes, including the Secure Desktop. This is how it:
- Only spawns processes after a user is idle for 8.5 minutes
- Terminates spawns when a user resumes from idle
The source scripts are available here:
https://github.com/r-alex-hall/farmComm