Click here to Skip to main content
11,930,069 members (50,419 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


8 bookmarked

WMI Reader

, 12 Sep 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
WMI Reader, also includes known WMI list.


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)

                    RootNode = newNode
                    RootNode = twWMIs.Nodes.Find(params(0), False)(0)
                End If

                ' Set Nodes
                Dim WMINode As New TreeNode(params(1))
                WMINode.Name = params(1)

            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...


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
Turkey Turkey
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151126.1 | Last Updated 12 Sep 2012
Article Copyright 2012 by Can SARIGÜL
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid