Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Write a perl script that when run (on start up) uses the windows scheduler to create a scheduled job to start the service two hours later. The job will run once and then be removed from the scheduled list. The user that the service runs as is configured in the services control panel.
The following example starts the service 'myService' after 7200 seconds (two hours).
#! /usr/bin/perl -w use strict; use warnings; my $command = "net start myService"; my $delay = 7200; my $startTime = time + $delay; my ($seconds, $minutes, $hours, $day) = localtime $startTime; `at $hours:$minutes /next:$day $command`; inman In reply to Re: starting a win2000-service with delay
by inman
|
|