Sunday, 26 June 2016

How to schedule a windows service automatic restart?

Or, Schedule windows service restart.
Or, Windows service restart using Windows Task scheduler.

Descriptions:  To schedule a windows service restart, you first need to create .bat script suitable for windows task scheduler and then schedule this .bat script execution schedule using Windows Tasks Scheduler

My Scenario: I want to schedule automatic restart of windows update service.
Below are the steps:
1. Create a .bat file for service restart, please refer the article “http://www.techiessphere.com/2016/06/windows-service-restart-script-suitable.html” for creating this .bat script.
2. Go to Start > Search > Task > Task Scheduler

























3. Click on Create Task








4. In General Tab, Name the task > Select the option “Run whether user is logged on or not” > Change user to Local Admin



















5. In the Triggers Tab, Click on “New




















6. Select the settings and configurations as per your requirements























7. In the Action Tab, Click on “New”



















8. In Action drop-down menu, Select  Start a program” > Browse and select the script that you have created > Click on OK




















That’s enough for creating a task schedule for restarting the service you need, but if you still want to look for any additional parameters to be defined in this task schedule, you may refer the “Conditions” and “Settings” Tab for more.

No comments:

Post a comment