Discussion Locked

Script startup & stop of service

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How can i set a service to start and stop at certain times in order that i can do a backup of a database. I assume i need to write a script and put it in scheduler, but i can't find one that works.

Server is windows 2000 SBS but operates as a simple file server with no domain.

6 replies

by cactus pete

You can use:

NET STOP "SERVICE NAME"
and
NET START "SERVICE NAME"

to handle the service.

To schedule this, use "at".

For usage, type "at /?" in a cmd window.

by beermonster

Hi,
Couple of things. As per the first answer a net use command needs to be passed the 'working' name of the service rather than the name that appears in the services mmc. these are nt always the same. to find the working name type

net start
and this will return the list of services in working name format. Secondly, you shouldn't be stopping services to back up a database (is it SQL?). the idea is to backup the database using the database engine - which can be scheduled and run while the db is in use - and then back up the resulting file.

This discussion is closed to new replies.