Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) throws IOException {
- try {
- String line;
- Process p = Runtime.getRuntime().exec("tasklist");
- BufferedReader input =
- new BufferedReader(new InputStreamReader(p.getInputStream()));
- while ((line = input.readLine()) != null) {
- System.out.println(line); //<-- Parse data here.
- }
- input.close();
- } catch (Exception err) {
- err.printStackTrace();
- }
- }
- }
Add Comment
Please, Sign In to add comment