programming-examples/perl/Win32/Starting services.pl
2019-11-15 12:59:38 +01:00

22 lines
405 B
Perl

$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() );
}