> Hello Everybody,
>
> Can you please tell me, How to access the processes
> shown in Windows Task Manager?
>
> I need to save the list of the currently executing
> processes, Which java
> class can be used for it?
>
> Thanks!
Hi,
You can't do that in pure java, you need to execute some native code.
Kaj
This piece of code will ouput the list of processes to the ouput stream.
You can parse each line and take whatever you need.
Process p = Runtime.getRuntime().exec("tasklist");
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = null;
while ((line = reader.readLine()) != null)
System.out.println(line);
Nope, not in java you don't...
By design the JVM divorces the programmer from platform specifics.
However, you could write a C/C++ program to emulate *nix's "ps -eaf" command on windows then then Runtime.exec("ps").
There's tonns of stuff on MSDN... just search for "enumerate process" in google, nineMSN (remember the deal with satan) or with MSDN's internal search.
You do have some interesting questions, don't you.
good luck... keith.