> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of eyal edri
> Sent: 23 March 2006 16:38
> To: perl-win32-users@listserv.ActiveState.com
> Subject: Get Service Description
 
> I'm using Win32:::OLE('in') to retrive win32 service names 
> (such as alerter).
>  
> I am looking for a function/method to retrve the desc or full 
> name of the service.
>  
> this is what i use: 
>  
> 
>  my $objWMIService = 
> Win32::OLE->GetObject("winmgmts:\\\\$ip\\root\\CIMV2") or die 
> "WMI connection failed.\n";
> 
>   my $colItems = $objWMIService->ExecQuery("SELECT * FROM 
> Win32_SystemServices", "WQL",
>                    wbemFlagReturnImmediately | wbemFlagForwardOnly);
>  
> 
>  foreach my $objItem (in $colItems) {
>    my $service = $objItem->{PartComponent};
>   
> 
> $service is the service (short system) name. 
> 
> Anyone know how can i get the description as well?

I would query the class Win32_Service, rather than Win32_SystemServices:

my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_Service",
                                         "WQL",
                                         wbemFlagReturnImmediately |
                                         wbemFlagForwardOnly);

You can then access:

$objItem->{Name}        - short name
$objItem->{DisplayName} - long name
$objItem->{Description} - description

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/
wmi/win32_service.asp

Does that help at all?

Cheers,
Paul


*****************************************************************
Gloucester Research Limited believes the information 
provided herein is reliable. While every care has been 
taken to ensure accuracy, the information is furnished 
to the recipients with no warranty as to the completeness 
and accuracy of its contents and on condition that any 
errors or omissions shall not be made the basis for any 
claim, demand or cause for action.

The information in this email is intended only for the 
named recipient.  If you are not the intended recipient
please notify us immediately and do not copy, distribute 
or take action based on this e-mail.

Gloucester Research Limited, 5th Floor, Whittington House, 
19-30 Alfred Place, London WC1E 7EA
*****************************************************************

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to