Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automate services restart in windows server 2003

I have a Jboss service in Windows server 2003. Is there a way to schedule the service to restart automatically on a daily basis?

like image 684
batty Avatar asked Aug 03 '11 21:08

batty


People also ask

How do I schedule a service to restart daily?

Open Task Scheduler (Start > in search type Task Scheduler and select when found). Once Task Scheduler opens, in the right column window click on Create Task... In the General tab, type a name for the service. Enable the "Run whether user is logged on or not" and "Run with highest privileges".


1 Answers

Put the following commands in a batch or cmd file and use windows scheduler to trigger it at desired schedule.

net stop <service_name>
net start <service_name>
like image 111
helios Avatar answered Sep 30 '22 00:09

helios