retrieve list of currently running user applications in Java

Discussion in 'Java' started by shraddha, May 23, 2005.

  1. shraddha

    shraddha Guest

    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
    shraddha, May 23, 2005
    #1
    1. Advertising

  2. Andrew Thompson, May 23, 2005
    #2
    1. Advertising

  3. shraddha

    Betty Guest

    "shraddha" <> wrote in message
    news:...
    > 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]
    Betty, May 23, 2005
    #3
  4. shraddha

    shraddha Guest

    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
    shraddha, May 29, 2005
    #4
  5. shraddha

    Lucy Guest

    "shraddha" <> wrote in message
    news:...
    > 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.
    Lucy, May 29, 2005
    #5
  6. shraddha

    shraddha Guest

    sorry, I forgot to mention. I am on a Windows machine.
    shraddha, May 30, 2005
    #6
  7. On 29 May 2005 19:47:13 -0700, shraddha wrote:

    > 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.

    --
    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
    Andrew Thompson, May 30, 2005
    #7
  8. shraddha

    Lucy Guest

    "shraddha" <> wrote in message
    news:...
    > 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.
    Lucy, May 30, 2005
    #8
  9. shraddha

    . Guest

    On Sun, 29 May 2005, shraddha wrote:

    > 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.

    --
    Send e-mail to: darrell dot grainger at utoronto dot ca
    ., May 30, 2005
    #9
  10. shraddha

    shraddha Guest

    > You also forgot to mention, are you your only user?
    Yes, I am the only user on this system.
    shraddha, May 31, 2005
    #10
  11. shraddha

    shraddha Guest

    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
    shraddha, May 31, 2005
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Blatt
    Replies:
    0
    Views:
    379
    Peter Blatt
    Oct 9, 2004
  2. Brian
    Replies:
    2
    Views:
    2,820
    Brian
    Dec 27, 2004
  3. Replies:
    7
    Views:
    373
  4. Yeounkun, Oh

    How can I get a name of function running currently.

    Yeounkun, Oh, Nov 16, 2004, in forum: C Programming
    Replies:
    2
    Views:
    442
    Stuart Gerchick
    Nov 16, 2004
  5. harryos
    Replies:
    2
    Views:
    435
    harryos
    Mar 11, 2011
Loading...

Share This Page