Imports System
Imports System.Management ' requires adding a reference to System.Management
Module Module1
Sub Main()
Try
Dim searcher As New ManagementObjectSearcher( _
"root\CIMV2", _
"SELECT * FROM Win32_ComputerSystemProduct")
For Each queryObj As ManagementObject In searcher.Get()
Console.WriteLine("UUID: {0}", queryObj("UUID"))
Next
Catch err As ManagementException
Console.WriteLine("An error occurred while querying for WMI data: " & err.Message)
End Try
Console.WriteLine("Finished, press ENTER")
Console.ReadLine()
End Sub
End Module
Imports System.Management ' requires adding a reference to System.Management
Module Module1
Sub Main()
Try
Dim searcher As New ManagementObjectSearcher( _
"root\CIMV2", _
"SELECT * FROM Win32_ComputerSystemProduct")
For Each queryObj As ManagementObject In searcher.Get()
Console.WriteLine("UUID: {0}", queryObj("UUID"))
Next
Catch err As ManagementException
Console.WriteLine("An error occurred while querying for WMI data: " & err.Message)
End Try
Console.WriteLine("Finished, press ENTER")
Console.ReadLine()
End Sub
End Module