How To Restart Windows Service Using Task Scheduler

Task Scheduler

The Task Scheduler is a Windows component that can automatically run tasks at a specific time or in response to a specific event. For example, tasks can be run when the computer starts or when a user logs in. You can start tasks when a specific event occurs, and using a task scheduler, you can run commands and execute scripts on a specific day and time.

Windows Services

In this demo, I am going to restart Cellular Time Service.

WindowsService

Getting Started

Search task scheduler in Windows search.

TaskScheduler

Right-click on Task Scheduler click New Folder give a name to the folder like Service reset and click OK.

NewFolder

Making a folder makes your tasks separate so that you can manage them easily.

Now right-click on the newly created folder, select Create Task, and provide the task name. In the general tab, enter Name and description, choose Run whether the user is logged on or not, and select Run with highest privileges.

Restart Notification

In the triggers tab, provide the scheduled date and time when you want to restart the service.

Schedule Servicve

In the actions tab, Enter NET in the Program/scripts path and put START “ServiceName” in the Add arguments(optional) text.

Action

Also, add one more action and put NET in the Program/script path STOP “ServiceName ” in the arguments text box, and click OK.

Task

Keep conditions and check Power options as selected in the given screenshot.

Properties

Your settings might be different, but I am keeping Allow task to be run on demand and Run task as soon as possible after a scheduled start is mossed and click OK.

Triggers

In the Task scheduled, you can see a created task, if can run right away or wait for the given scheduled time.

Conclusion

In this article, we have learned how to create a new task and set up Windows service restart using Windows 10 Task Scheduler.


Similar Articles