Restart a Windows service using C#
This example shows how to start, stop and restart a windows service programmatically in C#. Start service The following method tries to start a service specified by a service name. Then it waits until the service is running or a timeout occurs. public static void StartService(string serviceName, int timeoutMilliseconds) { ServiceController service = new ServiceController(serviceName); [...]