Click here to Skip to main content
15,881,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Experts,

I am working on license protection technology, in which i need to take/pass unique identifier of PC/Laptop/MAC. I choose Motherboard serial number. Is it wise option to take as unique id?

If not then please suggest. If yes then i need to know that how much long it can be?

Thanks in advance.

What I have tried:

I tried following code to fetch Motherboard serial number, i successfully got but i don't know how much longer it can be or what type of string it can be?

Function getBoardBaseSerialNo()
Dim baseNo As String
Dim objs As Object

Dim obj As Object
Dim WMI As Object
Dim sAns As String

WMI = GetObject("WinMgmts:")
objs = WMI.InstancesOf("Win32_BaseBoard")
For Each obj In objs
sAns = sAns & obj.SerialNumber
If sAns < objs.Count Then sAns = sAns & ","
Next
baseNo = sAns

Return baseNo
End Function

It Returns: 120801136603889
Posted
Updated 4-Apr-16 7:10am

Please take a look at this article, it will cover all your questions: Searching for a reliable hardware ID[^]

Short version: The only reliable source for a hardware-ID is the serial number of a harddisk.
 
Share this answer
 
There is no standard for serial number lengths for any device. There is also no guarantee that the device you're talking about even has a serial number accessible to your code.
 
Share this answer
 
Comments
Biinny 5-Apr-16 4:10am    
Thank you so much Dave for your help.

I faced the problem excetly you mentioned, i am not able to fetch motherboard serial number of one of my PCs using command prompt. Is it depicts that on that PC my code will not going to fetch the serial number?
Dave Kreskowiak 5-Apr-16 8:33am    
Since you never said what command line tool you're using or the command line you used to run it, it's impossible for anyone to say what went wrong.
Biinny 7-Apr-16 1:13am    
Hi Dave,

I am using "wmic baseboard get serialnumber" command to get motherboard id.

Thank You!
Dave Kreskowiak 7-Apr-16 10:45am    
OK, that's using Windows Management Instrumentation (WMI). There is no guarantee that the serial number will be available through WMI, not even for hard drives. There is nothing anywhere that says all hardware vendors have to support WMI and supply proper information to it.
See here: Win32_BaseBoard class (Windows)[^] buit all it says is "string" so it's really up to the manufacturer (as you'd expect) rather than a defined length.

You probably need to see this as well: windows - Motherboard ID - WMI C++ - Reliable? - Stack Overflow[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900