SC STOP WindowsServiceName
TIMEOUT /T 5 /NOBREAK
SC START WindowsServiceName
SC, TIMEOUT is command line tool
You need to execute batch file as ADMIN.
You can start stop windows service in Post Build Event.
TIMEOUT did not work for me in Visual Studio Build Post Event.
Please let me know if you have any question.
Thanks
Imran
EME