Problem:
 The below code for Lanman (creating or configing services) bails on me
in two ways...

  A> If I specify '',"","ServicesActive" for the $serverdb, I get a
useage message for Lanman...
        Usage: Win32::Lanman::CreateService($server, $servicedb,
\%param)
  B.> If I change $serverdb to simply be an empty field (ie.,
Win32::Lanman::CreateService($server,, \%param), then I get a 1722 error
(? RPC server is unavailable)...

Anyone know what 1722 really means for Lanman?  I know that Lanman can
generate its own codes that are meaningless to the net helpmsg command.

I can add a service with Win32::Daemon, but it ignores my type options,
which is why I moved to Lanman for this.  Any way to get Win32::Daemon
to pass those options?

System: Win2000 Pro
-------------------------------------------------------------
Notes:
* I have tried every allowable form for $server name
('','\\\\Babylon','Babylon',$ENV{'COMPUTERNAME'}....)
* All RPC and remote services are running (and Win32::Daemon works fine,
but I need to pass in things for type...)
-------------------------------------------------------------
Script:
###############
# Lanman test       #
###############
use Win32::Lanman;

%Hash2 = (
   name    =>  'MYSVC1',
   display =>  'MYSVC1',
   path    =>  'd:\mysvc.exe',
   type => (&SERVICE_WIN32_OWN_PROCESS | &SERVICE_INTERACTIVE_PROCESS)
);

if(!Win32::Lanman->CreateService('',,\%Hash2)) {
  die Win32::FormatMessage(Win32::Lanman::GetLastError() )."  :
".(Win32::Lanman::GetLastError())."\n";
}
print "Successfully added.\n";
-------------------------------------------------------------
Output:
The RPC server is unavailable.
  :  1722

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to