windows - I need to write a script that restarts a service periodically -


i need write script restarts service periodically. guess job keeps track of established connections specific port on server. once number of connections reached restart services.

here have far:

netstat -an | find /c ":80" //to find count  net stop "service name" //to stop service  net start "service name" //to start service 


Comments