We have a piece of software that requires a 2nd running program for document
generation, this 2nd program will stay running when the main program closes.
Right now we're just auto starting the 2nd program at login if its
installed, but I'd like to launch it only when its not already running
(because it creates nasty error messages when you try to run it twice) while
launching the main program.

The reason for this is that in our terminal server envirioment this 2nd
program is becoming a resource hog because it is being launched by everyone
who has access to that main program even though they are not using it.

Does anyone have a way to check for a running program (from the active user)
and then doing something depending on that result ?