<?xml version="1.0" encoding="windows-1252"?>
<node id="360201" title="LostS's scratchpad" created="2004-06-03 11:17:58" updated="2005-08-15 00:34:44">
<type id="182711">
scratchpad</type>
<author id="69464">
LostS</author>
<data>
<field name="doctext">
&lt;code&gt;
#!e:/perl/bin/perl -w
use strict;
use warnings;
use Win32::Process::Info;
use Data::Dumper;

my @processes = ("cogbootstrapservice.exe",
                 "java.exe",
                 "BIBusTKServerMain.exe",
                 "bpfis.exe",
                 "bpbkar32.exe");

my $pi = Win32::Process::Info-&gt;new ("server.domain.com", "WMI");
my @pids = $pi-&gt;ListPids ();    # Get all known PIDs
foreach my $pid (@pids) {
    my @info = $pi-&gt;GetProcInfo($pid);
#    print Dumper @info;
    my %info;
    foreach my $hash_ref (@info) {
        foreach (sort keys %{$hash_ref}) {
            foreach my $service (@processes) {
                if ($_ eq "Caption") {
                    if (${$hash_ref}{$_} =~ /$service/ig) {
                        print "$_ =&gt; ${$hash_ref}{$_}\n";
                    }
                }
            }
        }
    }
}
&lt;/code&gt;</field>
</data>
</node>
