----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 17, 2000 2:50 PM
Subject: Trouble useing Win32::Service
> I'm using ActiveState Perl build 522. I want to do something simple as
this:
> Check the status of the Schedule service on one machine. Can someone see
what
> I'm doing wrong because I can't get the result I wanted. If I code it this
way:
>
> #!perl -w
>
> use Win32::Service;
>
> my %status;
> GetStatus(T31764,Schedule,%status);
> print "\%status";
>
> I got error: Undefined subroutine &main::GetStatus called at
C:\w2k\shawn.pl
> line 8.
>
> If I call Win32::Service explicitly, as follow:
>
> #!perl -w
>
> use Win32::Service;
>
> my %status;
> Win32::Service::GetStatus(T31764,Schedule,%status);
> print "\%status";
>
> I got: Usage: Win32::Service::GetStatus(lpHostName,lpServiceName,status)
at
> C:\w2k\shawn.pl line 7.
>
> Am I missing something obvious? Win32 is listed under my perl\site\lib
dir,
> anything I need to do before I can use it?
>
$server = ('\\\\SRV01');
$service = ("SQLEngine");
$check = ("CurrentState");
Win32::Service::GetStatus($server, $service, \%status);
if ($status{$check} == 4){print "The Service is UP";}else{print "The Service
is not currently running";}
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin