Background Commands not running.
-
Hey @Russ. Really enjoying triggercmd so far. I am experiencing an issue where I am not able to run any "background" commands from a web trigger.
Here are some things I have done to troubleshoot:
- I removed the background services and reinstalled them with a reboot. I did this a couple times.
- I checked the logs and I see the commands being received, but then nothing else happens.
- I checked to see if the same commands work in foreground mode - they do.
- I simplified the commands to just "start notepad" - launches w/ foreground but does nothing with background mode.
- I checked services.msc and confirmed the TriggerCmdAgent is there.
- When I installed or removed bg services, node js prompted me with UAC.
- I can launch any of the commands from the Command editor GUI. Even if they are background mode.
{ trigger: 'notepad-background', id: 'XXXXXXXXXXXXXXXXXXXXX' } { trigger: 'notepad-foreground', id: 'XXXXXXXXXXXXXXXXXXXXX' } Running trigger: notepad-foreground Command: start notepad Reported: Command Ran
I am creating a "build machine" and I am using triggercmd to allow a team of software devs the ability to trigger a build any time they want. I would prefer to launch this build process with the background mode enabled.
-
I forgot to mention I am running windows 11 and Windows is updated.
I am running version 1.0.37 of triggercmd agent. -
@Adroit-Tester2, the background agent on Windows is meant to run commands that don't do anything with the GUI, like this reboot command:
shutdown /r /t 1
One benefit is the TRIGGERcmdAgent Windows service runs before you login, so you could reboot the PC even if it's not logged in.
Background commands run in the context of the TRIGGERcmdAgent Windows service that runs as Local System, which can be of benefit too because it has full access to your PC and it bypasses UAC.
Here's a test command you use try in background mode to verify it's working:
echo testing > c:\folder\log.txt
I just tried that and it produced the log.txt file when I ran it in background mode.
If you want to see the processes run, I suggest you leave them in foreground mode. You could still lock the PC after logging it on if you don't want the developers to mess with them.