Stuart McLachlan
stuart at lexacorp.com.pg
Sun Jan 4 18:40:11 CST 2004
On 4 Jan 2004 at 17:43, John Bartow wrote: > I was just wondering why the Main Circuit Board Serial Number isn't used for > this. It would seem to me that this would be about the most stable unique ID > number in a PC. I have no idea how you would read this number but it always > shows up in my hardware asset inventories. > > Any comments? Public Function MBSerialNumber() As String 'RETRIEVES SERIAL NUMBER OF MOTHERBOARD 'IF THERE IS MORE THAN ONE MOTHERBOARD, THE SERIAL 'NUMBERS WILL BE DELIMITED BY COMMAS 'YOU MUST HAVE WMI INSTALLED AND A REFERENCE TO 'Microsoft WMI Scripting Library IS REQUIRED Dim objs As Object Dim obj As Object Dim WMI As Object Dim sAns As String Set WMI = GetObject("WinMgmts:") Set objs = WMI.InstancesOf("Win32_BaseBoard") For Each obj In objs sAns = sAns & obj.SerialNumber If sAns < objs.Count Then sAns = sAns & "," Next MBSerialNumber = sAns End Function -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support.