Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: starting a win2000-service with delay

by inman (Curate)
on Sep 19, 2003 at 12:14 UTC ( [id://292643]=note: print w/replies, xml ) Need Help??


in reply to starting a win2000-service with delay

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

  • Comment on Re: starting a win2000-service with delay

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://292643]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (None)
    As of 2024-04-25 02:05 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found