Introduction
WMI (Windows Management Instrumentation) provides programmers with information about
the Operating System. This project includes the known WMI list.
Using the code
The Wmis.csv file contains the WMI paths like this:
- Keyboards and Pointing Devices;Win32_Keyboard
- Keyboards and Pointing Devices;Win32_PointingDevice
- Mapped Drives and File Shares;Win32_ConnectionShare
- Mapped Drives and File Shares;Win32_LogicalShareAccess
Private Sub LineUp()
Const FileName As String = "WMIs.csv"
Using fs As New FileStream(FileName, FileMode.Open)
Using sr As New StreamReader(fs)
While (sr.Peek > -1)
Dim Line As String = sr.ReadLine
Dim params() As String = Line.Split(";")
Dim RootNode As TreeNode
If Not twWMIs.Nodes.ContainsKey(params(0)) Then
Dim newNode As New TreeNode(params(0))
newNode.Name = params(0)
twWMIs.Nodes.Add(newNode)
RootNode = newNode
Else
RootNode = twWMIs.Nodes.Find(params(0), False)(0)
End If
Dim WMINode As New TreeNode(params(1))
WMINode.Name = params(1)
RootNode.Nodes.Add(WMINode)
End While
End Using
End Using
End Sub
Points of Interest
You can use WMI to learn information about your computer, Operating System, etc...
For example, network card mac address, installation date of OS, processor ID, etc... Please be sure
to use the UAC settings. You may need the admin rights while reading some WMI information...