Enumerate Services to Collection

By | 2019-08-22

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

FileUploadedSize
455-20190822-163554-enumerate_services.zip8/22/2019 4:35:54 PM4378
Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.