Question

What would be the best way to monitor open .exe programs on a local computer. I am guessing it would be creating a service that monitors programs that you have defined to be watched. When I say monitor/watched I mean it would create a text file loging when the defined .exe had been opened and when it closed on the local computer. Does this make sense?

Besides logging I want the service to communicate with a server in order to make sure only 5 computers for example are using 5 test.exe instances. So if the 6th computer opens test.exe then it will denie them. Our test server is running Windows 2008 R2 btw.

Any help or links would be awesome!

Was it helpful?

Solution

Well if it's for stopping inadvertently running the 3rd party application and you aren't trying to definitively block it happening.

Write a little application that launches this here Microstation and does WaitforSingleObject. Before it launches it checks against some central resource, if Okay, ups the count of that resource. When microstation closes it decrements.

Replace all the shortcuts for Microstation with the launcher app and you have something that will do the job for minimal effort.

You could even beef it and respond with who/where all the five instances are, and deal with per-machine / per-user if it's relevant.

OTHER TIPS

I think the best way to start a .exe (process) is using the Process class. This will able you to monitor it, when it's closed, even capture the standard input/output.

http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx

There should be audit events in corresponding log for all started application if configured properly. You should be able to read it if necessary.

Using Auditing to Track Which Applications Are Used

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top