Search Tools Links Login

Enumerate Services to Collection


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

About this post

Posted: 2019-08-22
By: AndreaTincani
Viewed: 250 times

Categories

Visual Basic 6

Attachments

enumerate_services.zip
Posted: 8/22/2019 4:35:54 PM
Size: 4,378 bytes

Special Instructions

This code originally appeared on AndreaVB.com, and has been republished here with the permission of Andrea Tincani.


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.