By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,264 Members | 1,637 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,264 IT Pros & Developers. It's quick & easy.

Kill Idle Process

P: n/a
Hi,

We have a limited number of licenses to some software we have
installed on our users desktops. The problem is that sometimes the
users open up the application and then don't use it all day. This
prevents others from being able to use the application because we run
out of licenses.

I'm thinking that we want to create a windows service using VB.Net
that we will run on everyone's machine and have it monitor this
application to see if it is idle for too long. If it is idle for too
long, we will then kill it and pop up a message to the users letting
them know what we did. Does anyone have any ideas? Any sample code?

Thanks!
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi, this isn't a code solution, but, have you even looked into Terminal
services? You can disconnect idle users automatically. I don't know what the
licensing is so you will have to look into it. Just a suggestion.
"Jim G" <jg****@williamblair.com> wrote in message
news:e5**************************@posting.google.c om...
Hi,

We have a limited number of licenses to some software we have
installed on our users desktops. The problem is that sometimes the
users open up the application and then don't use it all day. This
prevents others from being able to use the application because we run
out of licenses.

I'm thinking that we want to create a windows service using VB.Net
that we will run on everyone's machine and have it monitor this
application to see if it is idle for too long. If it is idle for too
long, we will then kill it and pop up a message to the users letting
them know what we did. Does anyone have any ideas? Any sample code?

Thanks!

Nov 20 '05 #2

P: n/a
Ot
So you want to have an application that

a) scans all the running processes
b) for an identified subset of those, determine how long each has been
"idle"
c) stop those whose idle time exceeds a threshold and
d) inform the user you have done so with a friendly message.

A pretty puzzle, and I hope some guru or other can help you.

I found some interesting stuff in System.Diagnostics.Process. If I am
reading that correctly, you can find the processes and their names (a).
You can find their state (e.g. idle in ProcessPriorityClass), but I don't
see an idle time in that class.

If you had a thread that checked the state every few seconds... but the
problem I see is that it may have gone un-idle and back to idle in the
interim. I suppose you could check resource usage -- TotalProcessorTime --
and if it is unchanged for the time period...

In any case,

Good Luck!
"Jim G" <jg****@williamblair.com> wrote in message
news:e5**************************@posting.google.c om...
Hi,

We have a limited number of licenses to some software we have
installed on our users desktops. The problem is that sometimes the
users open up the application and then don't use it all day. This
prevents others from being able to use the application because we run
out of licenses.

I'm thinking that we want to create a windows service using VB.Net
that we will run on everyone's machine and have it monitor this
application to see if it is idle for too long. If it is idle for too
long, we will then kill it and pop up a message to the users letting
them know what we did. Does anyone have any ideas? Any sample code?

Thanks!

Nov 20 '05 #3

P: n/a
On Fri, 19 Dec 2003 07:34:40 -0600, Otuse net wrote:
Perhaps there are some classes in WMI that would provide a means of
determining the apps idle state. Perhaps the WMI could be polled at
regular intervals and if the process's state had not changed, then take
action.
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.