Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone help with a peice of batch script to restart an application service at scheduled time.

For example: If the service is "windows firewall " Then the script should restart this service every day at 09:00 AM and 09:00PM . Can someone help with complete code.(Assume that there is no dependency of this service on any other service).Any help is greately appreciated.

Thanks Harry

share|improve this question

If you go to the services, and open Windows Firewall for example. You can see the service name, mpssvc. The way you would set the service to restart is by putting this in the batch file.

net stop mpssvc
net start mpssvc

You would want to save that to a shared location then add it to the scheduled tasks to run at the time you would like.

share|improve this answer

OR SC start NameOfService

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.