Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: get name of process with pid

by puploki (Hermit)
on Nov 18, 2005 at 17:18 UTC ( [id://509878]=note: print w/replies, xml ) Need Help??


in reply to get name of process with pid

Use Win32::Process:Info - here's some working code that I use in some production scripts, you can tailor it to do exactly what you want, but this should give you some ideas of the syntax.
use strict; use warnings; use Win32::Process::Info; Win32::Process::Info->Set (variant => 'WMI'); #Force to use WMI (quick +er) my $pi = Win32::Process::Info->new(); #Enumerate all the PIDs my $everest_process = undef; #For each PID, grab its name and look for everest processes for ( $pi->ListPids ) { my ($info) = $pi->GetProcInfo ($_); if ( $info->{Name} =~ /everest/gi ) { $everest_process = 1; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509878]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-24 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found