Batch file for restarting a service

Associate
Joined
8 Jul 2004
Posts
1,818
Location
London
What kind of commands do I need in a batch file to force it to restart service "X" on a server every 2 days?

OS: Windows 2003 Enterprise SP1
 
You can just setup a scheduled task (running under the necessary privileges) to run a batch file which does:-

Net Stop "X"
Net start "X"

But find out the name of the service first, by opening it service properties, the name is not always as it appears in the services.msc snap-in.
 
Hi mate,

So in notepad I type:
Net Stop "X"
Net start "X"

Save it as ServiceX.bat and create a new scheduled task to run it every 2 days?

Assuming of course the service name is actualy X.
 
Back
Top Bottom