-
[RESOLVED] List Services
I've been searching the forums and Internet and cannot find what I need. I want to list the services which are running on a machine. Actually, I don't need to list them all but some of them.
I need to show the Display Name or the Service Name... but all the snippets that I found list the EXE name. Does anyone know how to do this? TIA
-
Re: List Services
Try this
Code:
'Set a reference to WMI Scripting
Private Sub Command1_Click()
Dim serviceset As Object
Dim service As Object
Set serviceset = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_Service")
For Each service In serviceset
List1.AddItem service.Name & ": " & service.Description
Next
End Sub
-
Re: List Services
So close!! How do I get to know if the service is running or stopped?
-
Re: List Services
Found it!! It was service.state. Thank you, Hack!!
-
Re: List Services
You are welcome. :thumb:
If you consider this resolved, you could help us out by pulling down the Thread Tools menu and click the Mark Thread Resolved menu item. That will let everyone know that you have your answer.
Thank you. :)