Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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.