Here is a class and module that enumerates the services on a Windows computer. It gets each service and puts its info into a public collection which can be used anywhere in the program.
The attached ZIP file contains the full class module, as well as the standard module.
Usage
Option Explicit Private Sub Command1_Click()
Dim x As clsService
Dim strHostName as String
'Usage
'Call procedure, where strHostName is the name of the Machine, use "" for the
'Local Machine
strHostName=""
GetServiceInfo strHostName, SERVICE_ACTIVE Or SERVICE_INACTIVE
For Each x In colServices
MsgBox x.ServiceName
Next
End Sub
Attachments
File | Uploaded | Size |
---|---|---|
455-20190822-163554-enumerate_services.zip | 8/22/2019 4:35:54 PM | 4378 |