I used to use Scheduled Tasks
to run all my systems
administration scripts. However,
in a few situations, I found that
Scheduled Tasks wasn't as
efficient as I would've liked.
Sometimes, I needed a script to run
continuously or I had to know
immediately when a script
failed. For these special
situations, I tried to use the Schtasks
utility as well as a script to
schedule and manage tasks.
Although Schtasks works well
for its intended purpose, I had
limited success in using it for
my purpose because it was
difficult to get the systems
administration scripts' results in the
format I wanted. And using a
script to schedule and manage
tasks only works when the task
is created using the Win32_ScheduledJob class or the At
utility.
So, I tried running a few of
my systems administration
scripts as services. When you
run a script as a service, the
script can run constantly. Plus,
you have several recovery
options available. Through the
Recovery tab in a service's
Properties dialog box, you can
configure the service to restart itself
if it stops. Alternatively, you can
configure the service to run
another script or similar type of
program to alert you when it
stops. Another option is to
restart the computer, but in a
production environment, that
isn't advisable. . . .