Re: PID of Service



On Dec 19, 6:07 am, "Ferry Bolhar" <b...@xxxxxxxxxxxxxxxxx> wrote:
Good day to all,

Given the name of a Win32 service, is there a way to find out its PID from a
Perl script?

I looked at Win32::Service and Win32::Daemon modules, but couldn't find a
way for this.

Kind greetings,

--
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: ferdinand.bolhar-nordenka...@xxxxxxxxxx

use strict;
use warnings;
use Win32::Process::Info;

my $pi = Win32::Process::Info->new ();
my ($info) = grep {$_->{Name} =~ m/msnmsgr/} $pi->GetProcInfo();
print $info->{ProcessId};
.



Relevant Pages

  • PID of Service
    ... Given the name of a Win32 service, is there a way to find out its PID from a ... Perl script? ... Ing Ferry Bolhar ...
    (comp.lang.perl.misc)
  • Re: PID of Service
    ... Ferry Bolhar wrote: ... Given the name of a Win32 service, is there a way to find out its PID from a ... Perl script? ...
    (comp.lang.perl.misc)
  • Win32::Daemon for 5.8
    ... I want to run a perl script as a Win32 service. ... Ing Ferry Bolhar ... Magistrat der Stadt Wien - MA 14 ...
    (comp.lang.perl.misc)
  • Re: Catch pid for a process that created
    ... > Mav wrote: ... >> I am writing a perl script on windows that try to get the pid for a ... >> get that pid. ...
    (comp.lang.perl)
  • how to kill a spawned process when it hangs
    ... I run a perl script in which I call an interactive process which is ... # started via these back-tics. ... # How to capture pid of the process started from within those ...
    (comp.unix.shell)