473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Kill Idle Process

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
3 4384
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bob Swerdlow | last post by:
My application starts up a number of processes for various purposes using: self.popen = popen2.Popen3("/usr/local/bin/python -O "myscript.py") and then shuts them down when appropriate with...
3
by: john | last post by:
I don't want to know what the CPU utilization is right now. I want to get the average utilization over the last, for example, hour. So I came up with a method where I would get a Process object...
0
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a...
7
by: iwdu15 | last post by:
how can i tell if my system has gone idle? then how can i execute a command accordingly? thnks
1
by: Director - Minvent | last post by:
Hello, I am after some advice as to how to look to see if a process (a third party process i.e. not one created or started by my application) is running, find if it is idle and then kill it if...
1
by: Praveen_db2 | last post by:
Hi All I came across a small doubt. Suppose I have Max Connections parameter set to 200. There are now 200 connections to the database. Out of these 200 connections 50 are idle. What will happen...
6
by: TyBreaker | last post by:
I am using a performance counter to record the "Elapsed (CPU) time" of the "Idle" process. I record the elapsed time, wait 1 second and then record the new elapsed time. The result I get is: ...
1
by: AE_Cory | last post by:
I'm a n00b to Visual C++ and OOP, but not to programming in general. Here's the problem: Not knowing what I'm doing, I've made my VC++ application as a CLR Window Forms project. Now, I have a...
4
by: Richard Rossel | last post by:
Hi Fellows, I have a problem with process termination. I have a python code that apache runs through a django interface. The code is very simple, first, it creates a process with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.