2
如何获取有关Windows中其他(与perl.exe无关)进程的信息?获取有关Windows上其他进程的信息
说,我有一个脚本,希望监测一些关于所有firefox.exe
进程的基本信息。
我想这样做:
#!perl -w
use warnings;
use strict;
use MagicModule qw/ read_process_info /;
use Data::Dumper;
my $ps = MagicModule::read_process_info();
print Dumper($ps);
,看到类似:
$VAR = [
{
ProcessName => 'firefox.exe',
PID => 1234,
PirvateBytes => 21153546,
WorkingSet => 134566354,
# etc...
},
{
ProcessName => 'firefox.exe',
PID => 1556,
PirvateBytes => 15435487,
WorkingSet => 245774448,
# etc...
},
{
ProcessName => 'calc.exe',
PID => 2777,
PirvateBytes => 1024,
WorkingSet => 4096,
# etc...
},
];
因为我是通过分析从Systinternals' PSEXEC输出获取此信息,但显然这不是高效的。
什么是一些很好的Perl方法来获取这些数据?
(解决方案与草莓Perl的工作在Windows XP —的Windows 7将是首选)
[DBD :: WMI](http://p3rl.org/DBD::WMI)是更漂亮的界面。 – daxim 2012-04-17 11:22:53
我已经把它变成了生活,它就像一个魅力 - >接受:) – 2012-05-02 14:36:48