How can I start and stop a windows service from a c# Form application?
there is a dirtier, but same same..
just execute the shell command
NET STOP "MYSERVICENAME"
NET START "MYSERVICENAME"
EDIT:
Would like to expand on "dirtier":
1. it is slower.
2. this can result in some clever vulnerabilities
3. it is a code that is not "understandable"
4. it is highly not portable (surely if you use .NET Core)
I am sure there are more wrong with it...
but if you search for a small, inhouse tool... it'll do.
(would like to say temporary, but temp stuff stick best!)