How To Get All System Information In VB.NET

Hdisplay system infor

hey everyone so again a tutorial actually a console application tutorial but you will learn a lot from this things okay now i will tell you what information's you will be getting on the console
  • Your Operating System Full Name
  • Your Operating System Platform
  • Your Operating System Version
  • Your Windows Bit (32,64)
  • Your Computer Name
  • Your Computer Current Language Name
  • Your Computer Current Date And Time
  • Your Computer Manufacturer
  • Your Computer Model
  • Your Operating System Version
  • Your System Type
  • Your Windows Directory
  • Your Number Of Processes 
  • Your Computer Display Information
  • Your Ram Memory
  • Physical Memory
  • Virtual Memory
okay now lets create the program just create a console application and you will see the model 1 now add a class and name it WMI and add this codes into the WMI class

Public Class WMI
    Private objOS As Management.ManagementObjectSearcher
    Private objCS As Management.ManagementObjectSearcher
    Private objMgmt As Management.ManagementObject
    Private m_strComputerName As String
    Private m_strManufacturer As String
    Private m_StrModel As String
    Private m_strOSName As String
    Private m_strOSVersion As String
    Private m_strSystemType As String
    Private m_strTPM As String
    Private m_strWindowsDir As String
    Public Sub New()
        objOS = New Management.ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem")
        objCS = New Management.ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem")
        For Each objMgmt In objOS.Get
            m_strOSName = objMgmt("name").ToString()
            m_strOSVersion = objMgmt("version").ToString()
            m_strComputerName = objMgmt("csname").ToString()
            m_strWindowsDir = objMgmt("windowsdirectory").ToString()
        For Each objMgmt In objCS.Get
            m_strManufacturer = objMgmt("manufacturer").ToString()
            m_StrModel = objMgmt("model").ToString()
            m_strSystemType = objMgmt("systemtype").ToString
            m_strTPM = objMgmt("totalphysicalmemory").ToString()
    End Sub
    Public ReadOnly Property ComputerName()
            ComputerName = m_strComputerName
        End Get
    End Property
    Public ReadOnly Property Manufacturer()
            Manufacturer = m_strManufacturer
        End Get
    End Property
    Public ReadOnly Property Model()
            Model = m_StrModel
        End Get
    End Property
    Public ReadOnly Property OsName()
            OsName = m_strOSName
        End Get
    End Property
    Public ReadOnly Property OSVersion()
            OSVersion = m_strOSVersion
        End Get
    End Property
    Public ReadOnly Property SystemType()
            SystemType = m_strSystemType
        End Get
    End Property
    Public ReadOnly Property TotalPhysicalMemory()
            TotalPhysicalMemory = m_strTPM
        End Get
    End Property
    Public ReadOnly Property WindowsDirectory()
            WindowsDirectory = m_strWindowsDir
        End Get
    End Property
End Class

now add these codes inside the module1

Imports System.Management
Module Module1

    'Author : Mohamed Shimran
    'Blog :

   Dim bit As String
   Dim VGA As String
    Sub Main()
        If My.Computer.Registry.LocalMachine.OpenSubKey("Hardware\Description\System\CentralProcessor\0").GetValue("Identifier").ToString.Contains("x86") Then
            bit = "32-bit"
            bit = "64-bit"
        End If
        Console.Title = "System Information's"
        Console.WriteLine("your system information's")
        Console.WriteLine("Windows bit version: " + bit)
        Console.WriteLine("Computer Name: " & My.Computer.Name.ToString())
        Console.WriteLine("Computer Language: " & System.Globalization.CultureInfo.CurrentCulture.DisplayName)
        Console.WriteLine("Current Date/Time: " & Date.Now.ToLongDateString + ", " + Date.Now.ToLongTimeString)
        Dim objWMI As New WMI()
        With objWMI
            Console.WriteLine("Computer Manufacturer = " & .Manufacturer)
            Console.WriteLine("Computer Model = " & .Model)
            Console.WriteLine("OS Version = " & .OSVersion)
            Console.WriteLine("System Type = " & .SystemType)
            Console.WriteLine("Windows Directory = " & .WindowsDirectory)
        End With
        Console.WriteLine("Number of Processes: " & Environment.ProcessorCount.ToString)
        Dim moSearch As New ManagementObjectSearcher("Select * from Win32_Processor")
        Dim moReturn As ManagementObjectCollection = moSearch.Get
        For Each mo As ManagementObject In moReturn
            Console.WriteLine("Processor: " & (mo("name")))
        Dim ramsize As Integer
        ramsize = My.Computer.Info.TotalPhysicalMemory / 1024 / 1024
        Console.WriteLine("Memory: " & ramsize.ToString & "MB RAM")
        Dim WmiSelect As New ManagementObjectSearcher _
        ("root\CIMV2", "SELECT * FROM Win32_VideoController")
        For Each WmiResults As ManagementObject In WmiSelect.Get()
            VGA = WmiResults.GetPropertyValue("Name").ToString
        Console.WriteLine("Computer Display Info: " & VGA)
        Dim intX As Integer = Windows.Forms.Screen.PrimaryScreen.Bounds.Width
        Dim intY As Integer = Windows.Forms.Screen.PrimaryScreen.Bounds.Height
        Console.WriteLine("Screen Resolution: " & intX & " X " & intY)
        Console.WriteLine("Total Physical Memory: " & My.Computer.Info.TotalPhysicalMemory.ToString())
        Console.WriteLine("Total Virtual Memory: " & My.Computer.Info.TotalVirtualMemory.ToString())
        Console.WriteLine("Available Virtual Memory: " & My.Computer.Info.AvailableVirtualMemory.ToString())
        Console.WriteLine("Available Physical Memory: " & My.Computer.Info.AvailablePhysicalMemory.ToString())
        Console.WriteLine("Network Available: " & My.Computer.Network.IsAvailable.ToString())
        Console.WriteLine("Additional Info:")
        Console.WriteLine("Scroll Lock " & My.Computer.Keyboard.ScrollLock)
        Console.WriteLine("Num Lock " & My.Computer.Keyboard.NumLock)
        Console.WriteLine("Caps Lock " & My.Computer.Keyboard.CapsLock)
        Console.WriteLine("Current Processes: ")
        For Each p As Process In Process.GetProcesses
    End Sub
End Module

now just debug and see how it works :)

 I forgot to mention that you have to add System.Drawing, System.Windows, System.Management from reference and you have to add these namespaces
Imports System.Management
Imports System.Drawing
Imports System.Windows
Imports System.Windows.Forms
By the way I would like to thank the commenter who said about this.


You have to add three references:
-> System.Management
-> System.Windows
-> System.Drawing
And then import those namespace (I aint sure if that it's the name for them).
At least I had to. Everything worked fine!


Thanks you so much for letting me know :)


what if i need to but text box = java version
pls send to me in my mail


Why this long procedure
Maybe display information in msgbox

imports system
imports microsoft.win32 //Not even necesary

Public Class Form1

private sub form1_load()
msgbox("Operting System: " & My.Computer.Info.OSFullName & vbNewLine & " UserName: " & My.User.Name & vbNewLine & " HostName: " & strHostName & vbNewLine & " IPAddress: " & strIPAddress )
//You can add as much as you want
end sub

End Class

Knowledge is free


naaahhh i have a error 'span' is not declared. It may be inaccessible due to its protection level. and this '>'


that span is a HTML tag, it sometimes comes into the code. I don't know why ! still you delete the span and it will work :)


I loved the way you discuss the topic great work thanks for the share Your informative post.
HBR Cases Solution


CIITN is the best SAP training and placement Institute in noida. Contestant will analyze in keeping with modern-day enterprise trends by way of certified and industry experts & SAP training Institute in Noida. They provide a 100% placement help with the best training of IT cousrses.

If you are looking best sap training in Noida then you can join CIITN. One of the premier training and development institute for SAP Training Program in Noida. The company provides 6 weeks/ 6 Months Training for SAP. They provide training in all SAP Modules like SAP HANA,SAP B1, SAP FICO etc. Just come for free demo class and then join SAP and move up in your career .

SAP Training Institute in Noida
sap training in noida
sap institute in noida
sap course in noida
best sap training institute in noida

Sultan Faris mod

Thanks for sharing. share good information. Tutuapp APK


Very Interesting and wonderful information keep sharing this post kindly check
Windows Protection


Self-expression is a part of our consciousness, its direct manifestation!
tutuapp free
tutuapp vip


Self-expression is a part of our consciousness, its direct manifestation!
tutuapp free
tutuapp vip


Post a Comment

Note: Only a member of this blog may post a comment.