retrieve list of currently running user applications in Java

S

shraddha

Hi

Does anyone know a way of getting the details of the user applications
that are currently running on his machine? To be very specific, I want
to get the list of all applications that are currently running on my
machine (the list of applications that shows up in the 'Applications'
tab of the Windows Task Manager)

Is there a way I can retrieve this list in Java?
Any tips/suggestions/pointers will be appreciated.

Thanks,
Shraddha
 
B

Betty

shraddha said:
Hi

Does anyone know a way of getting the details of the user applications
that are currently running on his machine? To be very specific, I want
to get the list of all applications that are currently running on my
machine (the list of applications that shows up in the 'Applications'
tab of the Windows Task Manager)

Is there a way I can retrieve this list in Java?
Any tips/suggestions/pointers will be appreciated.
Here is a command you can execute.

Tasklist
Displays a list of applications and services with
their Process ID (PID) for all tasks running on
either a local or a remote computer.
Syntax
tasklist[.exe] [/s computer] [/u domain\user
[/p password]] [/fo {TABLE|LIST|CSV}] [/nh]
[/fi FilterName [/fi FilterName2 [ ... ]]]
[/m [ModuleName] | /svc | /v]
 
S

shraddha

Hi Betty,

Thanks for your reply. But what I am looking for is the applications
started by the user i.e. the user processes and not the system
processes. And more details of these processes like when the process
was started, which application loaded other application.

Can anyone point me to some program/tool that gives me these details?

Thanks in anticipation,
Shraddha
 
L

Lucy

shraddha said:
Hi Betty,

Thanks for your reply. But what I am looking for is the applications
started by the user i.e. the user processes and not the system
processes. And more details of these processes like when the process
was started, which application loaded other application.

Can anyone point me to some program/tool that gives me these details?

Thanks in anticipation,
Shraddha

Sounds like "ps -fa" so you can just run that.
 
A

Andrew Thompson

sorry, I forgot to mention. I am on a Windows machine.

You also forgot to mention, are you your only user?

No? So what is the *user* *base*?

If the user base is purely Windows, it might be better to write
this in .NET. Such a task would be trivial using the .NET framework.
 
L

Lucy

shraddha said:
sorry, I forgot to mention. I am on a Windows machine.

Me too. There is a command "tasklist" you can execute then.
It displays what you want. Look for it in 'help' or "tasklist/?" to get the
options

I might suggest that you do "tasklist /v /fo csv" then use "split()" in
java.

Tasklist
Displays a list of applications and services with their Process ID (PID)
for all tasks running on either a local or a remote computer.
 
?

.

sorry, I forgot to mention. I am on a Windows machine.

Shraddha,

If I was not reading this as a thread I would have no idea what your
message was about. When you are replying to a message you should copy the
text from the previous message. If not, you should write a proper reply.
For example,

In reply to your message about retrieving a list of user processes
someone suggested using the ps command. As you have noted above, you are
running on a Windows machine and do not have the ps command available to
you. There are two possible answers to this problem. The first is to write
an application that will retrieve the information you need (in C, C++ or
some other language). The second is to get a utility that does what you
want. Have a look at www.sysinternals.com and see if they have something
equivalent to the UNIX ps command.

You can also check msdn.microsoft.com and see if they have a tutorial on
example processes. You can use this code to write your own utility.
 
S

shraddha

You also forgot to mention, are you your only user?
Yes, I am the only user on this system.
 
S

shraddha

Hi all,

Thanks for all your inputs. I ended up using WMI for getting the
process details. I also used 'tasklist' to get the window title for the
user process.

I am sorry for any confusion / inconvenience caused as some of you
pointed out.
Will keep them in mind the next time.

I appreciate your replies. Thanks again.
Shraddha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top