in reply to Validating that service is fully stopped in Windows

get the pid , you could use GetServices() to get shortname, then use Win32::Process::Info to associate shortname with a pid

Once you have pid you might check if proc is alive with kill or http://search.cpan.org/perldoc/Win32::Process#Win32::Process::Open($obj,$pid,$iflags) or just sleep then enumerate all procs again

Or you could use WMI, either like this (PID of Service) using DBD::WMI

#!/usr/bin/perl use strict; use warnings; use DBI; use Win32::OLE qw(in); my $dbh = DBI->connect('dbi:WMI:'); my $sth = $dbh->prepare(<<WQL); SELECT * FROM Win32_Service WHERE Name = '$ARGV[0]' WQL $sth->execute(); if (my $row = $sth->fetchrow()) { printf( "%-20s - %10s %8i\n\t%s\n", $row->Name, $row->State, $row->ProcessID, $row->PathName ); }

Or the same query using wmic