Try putting a error check around the StartService and GetStatus method calls
like so:

 if( Win32::Service::StartService($hostName ,$serviceName) ){
     print "Successfully started service $serviceName.\n\n";
 }
 else {
     print "Error: ";
     print Win32::FormatMessage( Win32::GetLastError() ), "\n\n";
 }

HTH,
Trevor Joerges

----- Original Message ----- 
From: "Kraaijer Ronald" <[EMAIL PROTECTED]>
To: "'Sisyphus'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 12, 2003 6:29 AM
Subject: RE: Win32::Service


> Tried warnings, unfortunally did not give me any usefull hints.
>
> -----Original Message-----
> From: Sisyphus [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 12, 2003 12:24 PM
> To: Kraaijer Ronald
> Cc: [EMAIL PROTECTED]
> Subject: Re: Win32::Service
>
>
> Kraaijer Ronald wrote:
> > Hi,
> >
> > I want to manage services on my Win NT 4 station using Win32::Service,
but
> > somehow it doesn't do as asked.
> > Below a code snippet, the service Alerter is not started when I'm
running
> > this.
> >
> > Any Ideas?
> >
>
> use warnings;
>
> > use Win32::Service;
> > $hostName = "127.0.0.1";
> > $serviceName = "Alerter";
> > %status = "";
> > $ref = \%status;
> > Win32::Service::StartService($hostName ,$serviceName);
> >
> > Win32::Service::GetStatus($hostName, $serviceName, $ref);
> >
>
> Hopefully that will provide a clue as to what the problem is.
>
> Cheers,
> Rob
>
> -- 
> Any emails containing attachments will be deleted from my ISP's mail
> server before I even get to see them. If you wish to email me an
> attachment, please provide advance warning so that I can make the
> necessary arrangements.
>
>
____________________________________________________________________________
____
> Disclaimer - Winterthur Europe Assurances - Avenue des Arts/Kunstlaan 56 -
1000 Brussels - Belgium.
> This e-mail is intended solely for the above-mentioned recipient and it
may contain confidential or privileged information. If you have
> received it in error, please notify the sender immediately and delete the
e-mail. You must not copy, distribute, disclose or take any
> action in reliance on it.
> This e-mail message and any attached files have been scanned for the
presence of computer viruses. However, you are advised that
> you open any attachments at your own risk.
>
>
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to