Skip to Main Content

Java Programming

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!

Running tasks with full path

802547Feb 13 2011 — edited Feb 13 2011
Is it possible to list running applications with full path? I tried to use the tasklist.exe, but I don't know how can I get the paths.
        BufferedReader br = null;
        String username = System.getProperty("user.name");
        try {
            Process p = Runtime.getRuntime().exec("tasklist /v /fo table");
            br = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String s;
            while ((s = br.readLine()) != null) {
                if (s.contains(username)) {
                    System.out.println(s);
                }
            }
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2011
Added on Feb 13 2011
5 comments
226 views