Restart Windows Service Using Commands

WindowsA client has recently been having an issue with a process which appears to starts having problems after it has been running for a few days. While the application was investigated, they wanted to restart the service periodically restarted automatically.

The below Windows command script was created to stop the named service, wait 30 seconds and then start the service again:

@echo off

net stop {service name}

timeout 30

net start {service name}

exit

Change the highlighted section to the name of the service to be stopped and started.