Certain Windows services may misbehave and can hung (respond no
longer). It may be quite tricky to determine the actual service state.
A Windows service may be in one of four states:
SERVICE_STOPPED
SERVICE_START_PENDING
SERVICE_RUNNING
SERVICE_STOP_PENDING
When a service is stopped, its state through services.msc control panel applet
and from net.exe command will both report it as stopped. When it's running,
they both will report it as running. However, when a service is in a pending state,
it will be reported as running as well.
The solution is to use sc.exe from Resource Kit and use its query syntax to determine the
actual service state, i.e.
sc.exe query servicename
It will return the true service state. Also, the sc.exe can be used to control, create,
modify or delete service, as well, thus providing all the necessary interface in command-line mode. IPHost Network Monitor.
A Windows service may be in one of four states:
SERVICE_STOPPED
SERVICE_START_PENDING
SERVICE_RUNNING
SERVICE_STOP_PENDING
When a service is stopped, its state through services.msc control panel applet
and from net.exe command will both report it as stopped. When it's running,
they both will report it as running. However, when a service is in a pending state,
it will be reported as running as well.
The solution is to use sc.exe from Resource Kit and use its query syntax to determine the
actual service state, i.e.
sc.exe query servicename
It will return the true service state. Also, the sc.exe can be used to control, create,
modify or delete service, as well, thus providing all the necessary interface in command-line mode. IPHost Network Monitor.