In searching this site, i have seen plenty of posts and answers detailing how
to check the status of a service.
Many services, however, will "hang". Their status says that are running,
but in reality the service is non-responsive.
In light of this, I am using the ExecuteCommand method of the specified
servicecontroller to "ping" teh service. In that method I pass it a command
(an arbitrary number higher than 245). My understanding is that Services
will ignore commands that they don't recognize. Such as:
If ServiceName.Status = ServicecontrollerStatus.running then
ServiceName.Executecommand(248)
end if
My thinking is that if the service is "hung" or nonresponsive, it will error
out and fall into my Try-Catch which tells me it is hung, otherwise it will
just ignore the command and continue.
Is my thinking correct in this?
Scott
--
Thanks,
Scott