Windows running application list using Java

前端 未结 4 805
醉梦人生
醉梦人生 2020-12-18 10:51

How to get Windows running application list using Java?I got to get the processlist.

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 11:16

    You can run some command line util from Java for collecting processes information. For example:

    Process process = Runtime.getRuntime().exec("qprocess");
    BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
    

    Then you just read its output and parse it. qprocess is a standard Windows XP utility. In other versions of Windows you probably need some other utility.

提交回复
热议问题