How to caputre the "Stating" windows Service State

G

Guest

Hi all,

I want to find out if the windows service is currently in the state -
"starting" ?. I want to display the status accordingly in the web site. Hence
is there any OS command or any other tool which says "Starting".. From my
web site i require these three states "Running"/"Stopped"/"Started", the
first two states are each to check via a Socket connection for the specific
port.

But for the state "Starting.." i guess we need to depend on the OS, any
ideas how we can find out out ??

Like say when i right click any of the service and say start, it gives a
message "Starting windows service..." i want to capture this "starting"
message through some scripting, how to do this ?

Thank You..
Dinesh
 
R

Ramesh, MS-MVP

Win32_Service: (WMI Scripting)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_service.asp

Microsoft Windows 2000 Scripting Guide - Returning All Properties of
Selected Instances of a Class:
http://www.microsoft.com/technet/scriptcenter/guide/sas_wmi_qyel.mspx?mfr=true

-or-

Microsoft Windows XP - SC:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sc.mspx?mfr=true

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


Hi all,

I want to find out if the windows service is currently in the state -
"starting" ?. I want to display the status accordingly in the web site.
Hence
is there any OS command or any other tool which says "Starting".. From my
web site i require these three states "Running"/"Stopped"/"Started", the
first two states are each to check via a Socket connection for the specific
port.

But for the state "Starting.." i guess we need to depend on the OS, any
ideas how we can find out out ??

Like say when i right click any of the service and say start, it gives a
message "Starting windows service..." i want to capture this "starting"
message through some scripting, how to do this ?

Thank You..
Dinesh
 
G

Guest

Hi Ramesh,

Thanks for your quick reply. I have heard about WMI scripts, but never used.
Will try it.

Also the SC command for finding the state of the service was very useful.
Highly appreciate your help and the pointer.

Again Thank You very much.. Take care..

Dinesh
 
R

Ramesh, MS-MVP

You're welcome Dinesh.

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


Hi Ramesh,

Thanks for your quick reply. I have heard about WMI scripts, but never used.
Will try it.

Also the SC command for finding the state of the service was very useful.
Highly appreciate your help and the pointer.

Again Thank You very much.. Take care..

Dinesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top