Choose Your Language

Sunday, 14 July 2013

java program to list all processes that are active in task manager

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author Aravind Sankaran
 */
public class ListProcessesTaskManager {
    public static void main(String a[]) throws IOException{
       String processes;
       BufferedReader input = new BufferedReader(new  InputStreamReader(Runtime.getRuntime().exec("tasklist.exe").getInputStream()));
       while ((processes = input.readLine()) != null) {
               System.out.println(processes);
                }
        input.close();
    }
}




No comments:

Post a Comment