0
可能重复:
How do you list all processes on the command line in Windows?列表中的任务管理器进程
我想列出像使用Java任务管理器 “中svchost.exe”, “explorer.exe的” 所有进程。 如果可能,我还想知道每个进程使用的内存量。
我希望能有一个纯Java的解决方案,从this question
可能重复:
How do you list all processes on the command line in Windows?列表中的任务管理器进程
我想列出像使用Java任务管理器 “中svchost.exe”, “explorer.exe的” 所有进程。 如果可能,我还想知道每个进程使用的内存量。
我希望能有一个纯Java的解决方案,从this question
调整命令行的答案如果你是窗口
Process proc = Runtime.getRuntime().exec ("tasklist.exe");
InputStream Outputp = proc.getInputStream();
if(proc.waitFor() ==0){...//print Outputp}
的Linux: -
Process proc = Runtime.getRuntime().exec ("ps -A");
运行' tasklist'使用'Runtime.exec' – adatapost