How to verify if a windows service is stopped or running and wait until it is in this state?
Dim s As New ServiceController("Aservice")
s.Refresh()
If s.Status = ServiceControllerStatus.Running Then
s.Stop()
End If
s.Refresh()
The problem is that I want to wait in this function until the service is in that state... How can I do this? tnx!