Hello, i've used this code to get the System serial number in a W7 32 bits and works perfectly, but this doesn't work in 64Bits.
Private Function SystemSerialNumber32() As String
Dim mother_boards As Variant
Dim board As Variant
Dim wmi As Variant
Dim serial_numbers As String
' Get the Windows Management Instrumentation object.
Set wmi = GetObject("WinMgmts:")
' Get the "base boards" (mother boards).
Set mother_boards = wmi.instancesof("Win32_BaseBoard")
For Each board In mother_boards
serial_numbers = serial_numbers & ", " & _
board.SerialNumber
Next board
If Len(serial_numbers) > 0 Then serial_numbers = _
mid$(serial_numbers, 3)
SystemSerialNumber32 = serial_numbers
End Function
I've tried changing "Win32_BaseBoard" to "Win64_BaseBoard" and doesn't work
Re: How to get SystemSerialNumber in 64-Bit system?
The WMI Service is an admin scripting tool and is not meant to be used in real applications. It may be disabled or secured which could result in your programs crashing anyway.
In any case most of what it can return about the local system can be obtained far more directly.
I have attached a Project with a very stripped down version of the more complete SMBIOS query Class I posted to the CodeBank: [VB6] Read SMBIOS info w/o WMI.
This minimal version only retrieves the serial number (if available at all).
Seems to run just fine on both 32- and 64-bit Windows PCs. I tested three, one has no serial number (64-bit) and the other two (32-bit and 64-bit) do.
Re: How to get SystemSerialNumber in 64-Bit system?
Hi dilettante, I'm looking for a UniqueID in a 64bit Windows.
In a 32bit Windows I've using SystemSerialNumber, but I can't get anything from 64bit system.
Re: How to get SystemSerialNumber in 64-Bit system?
Some PCs simply don't have one. It has nothing to do with what OS is installed.
The best thing you can do is grab a lot of things that might be unique and combine them. PCs do not have unique IDs, and when Intel tried adding one to their CPUs there was a huge uproar over it and so they disabled the feature.
Some people will grab the first network adapter's MAC address, but that can be changed by users. Some will try to grab the system drive's physical serial number, but people replace drives. Some will fish out the Windows Product Key value.
But you almost have to grab several items and hash them together.
Re: How to get SystemSerialNumber in 64-Bit system?
Originally Posted by dilettante
Some PCs simply don't have one. It has nothing to do with what OS is installed.
The best thing you can do is grab a lot of things that might be unique and combine them. PCs do not have unique IDs, and when Intel tried adding one to their CPUs there was a huge uproar over it and so they disabled the feature.
Some people will grab the first network adapter's MAC address, but that can be changed by users. Some will try to grab the system drive's physical serial number, but people replace drives. Some will fish out the Windows Product Key value.
But you almost have to grab several items and hash them together.
Well, you can grab the HDD/SSD serial with WMI query.
hey, cpu serial number is not' enable/disabled in BIOS configuration?