It looks like it is probably hanging at the "else" after your 'print "test"'
statement - trying to create the new service. Have you tried putting a trace
print in the else section and then investigate getting some error feedback
from the Win32::Lanman call. My install of ActivePerl doesn't even have that
module listed in the help, so I don't know how it is supposed to work.
Tim MacAlpine
Subject: checking for the existence of a win2k service
Date: Mon, 25 Mar 2002 16:16:24 -0500
From: "Eric Logeson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Hello
I am trying to determine if a service on a win2k server machine exists, =
and if it doesn't exist create the service in question. I thought I =
could use something like:
Win32::Lanman::QueryServiceStatus("\\\\$hostname", '', "Myservice",
\%status);
print "test";
if (%status){
print "\nGood, Myservice already installed.\n";
}else{
Win32::Lanman::CreateService("\\\\$hostname", ' ', { name =3D>
'MyService',
display =3D>
'Myservice',
type =3D>
&SERVICE_WIN32_OWN_PROCESS,
start =3D>
&SERVICE_AUTO_START,
control =3D>
&SERVICE_ERROR_IGNORE,
filename
=3D> "C:\\WINNT\\myservice.exe",
account
=3D> 'LocalSystem',});
}
In this case "myservice" doesn't exist and the script hangs right after
print "test".
Thanks
Eric
_________________
Eric Logeson
919-680-5679
www.dukece.com
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs