A user asked about creating a trigger that would analyze the starts of defined processes, count them, and then execute a script if the count is higher than 1. Another question was posed about using a PowerShell script for this purpose. A suggestion was made to use the cmdlet (get-process -name processname).count to schedule a trigger and respond to it.
Read the entire ‘Creating a Trigger to Analyze Process Starts’ thread below:
Hi folks,
I think I posted my case in the wrong channel before, so I will try it again in this channel.
we created a script that restarts a process (eg. notepad) on a defined position.
now we look for a trigger that analyses the starts of defined processes and count them.
If the count is greater than 1 it should overhand the process-name as a variable and run our script (Script action)
For what it is: we have a few applications that sometimes opens outside the visible area. If this application has started a 2nd-time by the user it should be restarted at a defined visible position.
we don’t look at specifc process counts so a simple trigger won’t work. What you could do is a scheduled trigger that runs every x minutes and that looks at the count and do things with it
Thank you for the answer.
Another questen. Is there a way to create a powershell script that does the count for a specific process and implement it as a trigger?
(get-process -name processname).count for the count and schedule that with the followup action in it or if the number is > xx create a windows event and create a trigger to respond to that event
Continue reading and comment on the thread ‘Creating a Trigger to Analyze Process Starts’. Not a member? Join Here!
Categories: All Archives, ControlUp Scripts & Triggers