Visual Basic WMI System Services
Win32_LoadOrderGroup: WMI System Service Load Order Info
     
Posted:   Wednesday October 30, 2002
Updated:   Monday November 28, 2011
     
Applies to:   VB5, VB6
Developed with:   VB6, Windows XP
OS restrictions:   Windows NT, 2000, XP. See Prerequisites below.
Author:   VBnet - Randy Birch
     

Related:  

 
     
 Prerequisites
Windows Script Host is built into Microsoft Windows 98, 2000, ME and XP. If you are running Windows 95 or NT4, you can download Windows Script Host from the Microsoft Windows Script Technologies Web site at http://msdn.microsoft.com/scripting/. Some information is not returned on non-NT-based systems.

A reference set in Projects / References to the Microsoft WMI Scripting Library.


The Win32_LoadOrderGroup WMI class represents a group of system services that define execution dependencies. The services must be initiated in the order specified by the Load Order Group, as the services are dependent on each other. These dependent services require the presence of the antecedent services to function correctly.

This demo and illustration shows all the available information from the class.

 BAS Module Code
None.

 Form Code
To a form add a command button (Command1) and a listbox (List1). Set a reference in Projects / References to the Microsoft WMI Scripting Library, and add the following to the form:

Option Explicit
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright ©1996-2011 VBnet/Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce 
'               or publish this code on any web site,
'               online service, or distribute as source 
'               on any media without express permission.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub Command1_Click()

   Call wmiWin32LoadOrderGroup
   
End Sub


Private Sub Form_Load()
   
   Command1.Caption = "Win32_LoadOrderGroup"

End Sub


Private Sub wmiWin32LoadOrderGroup()
      
   Dim objset  As SWbemObjectSet
   Dim obj     As SWbemObject

   Set objset = GetObject("winmgmts:{impersonationLevel=impersonate}"). _
                                      InstancesOf("Win32_LoadOrderGroup")
   
   On Local Error Resume Next

   For Each obj In objset

      With List1
         .AddItem "Caption: " & obj.Caption
         .AddItem "Description: " & obj.Description
         .AddItem "Domain: " & obj.domain
         .AddItem "InstallDate: " & obj.InstallDate
         .AddItem "LocalAccount: " & obj.LocalAccount
         .AddItem "Name: " & obj.Name
         .AddItem "SID: " & obj.SID
         .AddItem "SIDType: " & obj.SIDType
         .AddItem "Status : " & obj.Status
         .AddItem ""
      End With
        
   Next
   
End Sub
 Comments
 

 
 

PayPal Link
Make payments with PayPal - it's fast, free and secure!

 
 
 
 

Copyright ©1996-2011 VBnet and Randy Birch. All Rights Reserved.
Terms of Use  |  Your Privacy

 

Hit Counter