Guest User

Untitled

a guest
Dec 10th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public class Main {
  2.  
  3. public static void main(String[] args) throws IOException {
  4. try {
  5. String line;
  6. Process p = Runtime.getRuntime().exec("tasklist");
  7. BufferedReader input =
  8. new BufferedReader(new InputStreamReader(p.getInputStream()));
  9. while ((line = input.readLine()) != null) {
  10. System.out.println(line); //<-- Parse data here.
  11. }
  12. input.close();
  13. } catch (Exception err) {
  14. err.printStackTrace();
  15. }
  16. }
  17. }
Add Comment
Please, Sign In to add comment