How To Get Computer Serial Number In Vbnet

You are polling the wrong WMI class/hive. Of course Microsoft is the OS manufacturer; what you need is Win32_ComputerSystem: Imports System.Management cs = New ManagementObjectSearcher('SELECT * FROM Win32_ComputerSystem') For Each objMgmt In cs.Get _Manufacturer = objMgmt('manufacturer').ToString() _Model = objMgmt('model').ToString() _SystemType = objMgmt('systemtype').ToString _totalMem = objMgmt('totalphysicalmemory').ToString() Next Manufacturer will be something like 'Dell, Inc', Model comes out spot on with mine, but has been known to sometimes include internal sub model identifiers. System type comes back as 'x64-based PC' on mine. MS has a WMI query builder somewhere to help fnd and use the right query, though it generates very wordy code. Give this a try in a console application. Just remember to add the System.Management reference to your project. You need to access the Win32_ComputerSystem not the Win32_OperatingSystem.

Is there any way to get Computer CPU ID, Processor ID & OS Serial No of an users machine in VB.NET? Regards, Vipul Mehta. Voda na sluzhbe u cheloveka prezentaciya youtube.

Sub Main() Dim objCS As Management.ManagementObjectSearcher Dim manufacturerName As String 'objOS = New Management.ManagementObjectSearcher('SELECT * FROM Win32_OperatingSystem') objCS = New Management.ManagementObjectSearcher('SELECT * FROM Win32_ComputerSystem') For Each objMgmt In objCS.Get manufacturerName = objMgmt('manufacturer').ToString() Next Debug.WriteLine('Manufacturer: ' & manufacturerName) End Sub Hope it helps.

Biblioteki dlya bazis mebeljschik 8 1. Imports System.Management Public Class Form1 Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim HDD_Serial, MB_serial As String Dim hdd As New ManagementObjectSearcher( 'select * from Win32_DiskDrive') For Each hd In hdd. Get HDD_Serial = hd( 'SerialNumber') Next Dim mboard As New ManagementObjectSearcher( 'select * from Win32_BaseBoard') For Each mb In mboard. Get MB_serial = mb( 'SerialNumber') Next End Sub End Class thank dear but there are errors in codes: Error 1 Type 'ManagementObjectSearcher' is not defined. C: Users Sh2007 Desktop hdd hdd Form1.vb 6 20 hdd Error 3 Statement cannot appear outside of a method body/multiline lambda. C: Users Sh2007 Desktop hdd hdd Form1.vb 9 5 hdd please help me.

Private Sub Form7_Load(sender As Object, e As System.EventArgs) Handles Me.Load Dim HDD_Serial, MB_serial As String Dim hdd As New ManagementObjectSearcher( 'select * from Win32_DiskDrive') For Each hd In hdd. Get HDD_Serial = hd( 'SerialNumber') Next Dim mboard As New ManagementObjectSearcher( 'select * from Win32_BaseBoard') For Each mb In mboard. Get MB_serial = mb( 'SerialNumber') Next MsgBox(MB_serial) End Sub Please mark those posts as answer which answers your question. Faraz thanks dear for your help but HDD_Serial is empty please check and help me . Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Dim Searcher_p As New ManagementObjectSearcher( 'root CIMV2', 'SELECT * FROM Win32_DiskDrive') For Each queryObj As ManagementObject In Searcher_p. Get() TextBox1.Text += (queryObj( 'SerialNumber').ToString.Trim) Next End Sub What is your main objective?