Starting services : Service « Win32 « Perl






Starting services

  

$status = Win32::Service::StartService($host, $service);

#!/usr/bin/perl -w

use Win32::Service;

$num_args = scalar( @ARGV );

$host = '';

$service = "yourServiceName";

$status = Win32::Service::StartService($host, $service);

if ($status) {
print "Started $service.\n";
} else {
    print_error();
}   
sub print_error {
    print Win32::FormatMessage( Win32::GetLastError() );
}

   
    
  








Related examples in the same category

1.Stopping services
2.Lists services(daemon) on a given system