Jump to content

Recommended Posts

Posted
We have a server service which is rather temperamental, and periodically takes its ball home until you restart it. I know how to use scripts/scheduled tasks to stop and start a service, but was wondering if it was possible to schedule a restart, or configure a pause into a command. Noob question, I know, but there you have it!
Posted

batch file where spooler is whatever service you want

 

net stop spooler && net start spooler

 

save that and stick it in task scheduler

  • Thanks 1
Posted
Thanks Sted, that looks perfect. What if my service name has spaces in it - do I need quote marks, or just write it out normally?
Posted (edited)

net stop "Service Name"

 

net start "Service Name"

 

Yes just put quotes around the service name and you can also use two ampersand symbols to make it do both commands one after the other

Edited by mac_shinobi
  • Thanks 1
Posted
Thanks you two, that works a treat.

 

Now I just need to wait for Capita to work out why I need to do this!

 

they expect users to do their testing as its cheaper is my guess

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...