Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting a list of windows processes

843810Jan 9 2006
Hi, in my java application I need to get a list of processes that Windows XP is running. I am currently using this code to get the list:
p = Runtime.getRuntime().exec("tasklist");

BufferedReader procInput = new BufferedReader(InputStreamReader(p.getInputStream()));
The problem is that the tasklist command only seems to work in Windows XP professional edition, and not in the 'Home' or 'Media Center' editions. While most people are running pro, in the interest of compatibility I would like it to work with all versions of windows. I've rooted around in the API, but I can't find another way to get a list of running processes. Any ideas? Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 6 2006
Added on Jan 9 2006
0 comments
132 views