General discussion

Locked

Script startup & stop of service

By Simon@SRN ·
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.

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Script startup & stop of service

by Cactus Pete In reply to Script startup & stop of ...

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.

Collapse -

by Simon@SRN In reply to Script startup & stop of ...

Poster rated this answer.

Collapse -

Script startup & stop of service

by BeerMonster In reply to Script startup & stop of ...

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.

Collapse -

by Simon@SRN In reply to Script startup & stop of ...

Poster rated this answer.

Collapse -

Script startup & stop of service

by Simon@SRN In reply to Script startup & stop of ...

Database is progress if that helps and size is just over 2GB

Collapse -

by Simon@SRN In reply to Script startup & stop of ...

This question was closed by the author

Back to Windows Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums