2012年4月6日

Tasklist使用详解

摘要: 用jstat查看jvm内存的使用的情况时,因为是windows机器,不能使用top命令方便的查出来,进程好在网上搜了一下看到了在windows原来使用的是tasklist特意将tasklist的用法记录下来。原帖的地址是:http://hi.baidu.com/lgh_boffin/blog/item/314b1194fb957c18d21b70b6.html“Tasklist”命令是一个用来显示运行在本地或远程计算机上的所有进程的命令行工具,带有多个执行参数。它的使用格式为:TASKLIST [/S system [/U username [/P [password]]]] [/M [mo. 阅读全文

posted @ 2012-04-06 15:39 waruzhi 阅读(4684) 评论(0) 推荐(0) 编辑

java 调用 cmd 中的 tasklist 来获取特定进程的PID

摘要: //显示进程Process process = Runtime.getRuntime().exec("tasklist");Scanner in=new Scanner(process.getInputStream());while(in.hasNextLine()){String p=in.nextLine();//打印所有进程System.out.println(p);if(p.contains("javaw.exe")){StringBuffer buf=new StringBuffer();for(int i=0;i<p.length(); 阅读全文

posted @ 2012-04-06 15:34 waruzhi 阅读(3873) 评论(0) 推荐(0) 编辑

导航