Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

retrieve list of currently running user applications in Java

Thread view: 
shraddha - 23 May 2005 01:09 GMT
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
Andrew Thompson - 23 May 2005 03:12 GMT
> Hi

Hi Again..

Please do not multi-post.
<http://www.physci.org/codes/javafaq.jsp#xpost>

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Betty - 23 May 2005 03:36 GMT
> Hi
>
[quoted text clipped - 6 lines]
> 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]
shraddha - 29 May 2005 00:35 GMT
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
Lucy - 29 May 2005 05:53 GMT
> Hi Betty,
>
[quoted text clipped - 7 lines]
> Thanks in anticipation,
> Shraddha

Sounds like "ps -fa" so you can just run that.
shraddha - 30 May 2005 03:47 GMT
sorry, I forgot to mention. I am on a Windows machine.
Andrew Thompson - 30 May 2005 03:53 GMT
> 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.

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

shraddha - 31 May 2005 04:52 GMT
> You also forgot to mention, are you your only user?
Yes, I am the only user on this system.
Lucy - 30 May 2005 19:02 GMT
> 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.
"." - 30 May 2005 21:55 GMT
> 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.

Signature

Send e-mail to: darrell dot grainger at utoronto dot ca

shraddha - 31 May 2005 05:01 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.