Fog Creek Software
Discussion Board

access registry info detect service failure

hi, i need to access the registry information inorder to check if windows services r running or have failed,using vc++ .
hope to receive help.

Thanking u,

vandana gopalakrishnan
Sunday, December 14, 2003

I don't think the registry has that information.  I think you want to connect to the Service Control Manager, enumerate through the services, and query the one you're interested in for its status.  Plenty of sample code at MSDN.

Sunday, December 14, 2003

I've done this with ADSI before using the WinNT namespace provider, something like (in VB):
  Set svc = "WinNT://ComputerName/Spooler,Service"
  MsgBox svc.Status

Ponty Mython
Sunday, December 14, 2003

Doh, that should've been:
  Set svc = GetObject("WinNT://ComputerName/Spooler,Service")

Ponty Mython
Sunday, December 14, 2003

*  Recent Topics

*  Fog Creek Home