Function IsServiceRunning(sServiceName)
Dim objInst, objSet
IsServiceRunning=FALSE
Set objSet = GetObject("winmgmts:").ExecQuery("SELECT * FROM
Win32_Service")
For each objInst IN objSet
If (UCase(sServiceName) =
UCase(objInst.Name)) And (UCase(objInst.State) = UCase("Running")) then
IsServiceRunning=TRUE
End if
Next
End Function