I got stuck again. I wrote the follwoing script to install a perl script as a service. Install/Uninstall works fine, but I'm not able to start the service. The Error Code I run into is 2186 (I'm working on a german Win2K-Box so please see "net helpmsg 2186" for details :-)).
As you can see I try to run the service as a different user then Admininstator.
Any help/hint is greatly appreciated!
Alex
# Interpreter: C:/Programme/Perl/bin/perl.exe
use Win32::Daemon;
$sidir = "C:\\Programme\\Serv-Int-Programme"; $file = "$sidir\\winupdate_local.pl"; $Machine = "\\\\" . Win32::NodeName(); Win32::Daemon::Timeout( 90 );
%ServiceConfig = (
name => 'scwinupdate',
display => 'sc Windows Update Service',
path => 'C:\\Programme\\Perl\\bin\perl.exe',
user => '.\serv-int',
password => 'perl',
parameters => $file,
depedencies => [],
);if ($installflag eq "i") {
if ( Win32::Daemon::CreateService( \%ServiceConfig ) ) {
print "$ServiceConfig{display} successfully installed\n";
}else{
print "$ServiceConfig{display} could not be installed\n";
print "Error: ";
print Win32::FormatMessage( Win32::Daemon::GetLastError() ), "\n";
}
}elsif ($installflag eq "u" ) {
if ( Win32::Daemon::DeleteService( $Machine, $ServiceConfig{name} ) ) {
print "$ServiceConfig{display} successfully uninstalled\n";
}else{
print "$ServiceConfig{display} could not be uninstalled\n";
print "Error: ";
print Win32::FormatMessage( Win32::Daemon::GetLastError() ), "\n";
}
}-- _________________________________creating IT solutions Alexander Apprich science + computing ag IT-Services Hagellocher Weg 71-75 phone +49(0)7071 9457-291 D-72070 Tuebingen, Germany fax +49(0)7071 9457-211 www.science-computing.de
_______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
