Obtaining Baseboard (Motherboard) Information using WMI
http://vbnet.mvps.org/inde
Obtaining Processor Information using WMI
http://vbnet.mvps.org/inde
Main Topics
Browse All TopicsHi all ..?
i developed a software in vb 6 and now i want to put some security in Instalations or running on my clien's machine..
tel me how can i get a Motherboard or CUP serial number through VB6 program ...
and how can i able to check through Instalation process of software...
Thanks
ISKPatel
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Obtaining Baseboard (Motherboard) Information using WMI
http://vbnet.mvps.org/inde
Obtaining Processor Information using WMI
http://vbnet.mvps.org/inde
I wouldn't recommend using volume serial number (as described by Vimalchand above) since this number will change if you format your drive.
I'm currently developing a piece of software that will do a hardware and software inventory of all computers, and what I've found best to use for secure identification is CPU id and BIOS id.
These can be retrieved by using WMI, as in my example below.
WMI is very powerful and can be used to get all available info about the computer.
Check here if you want to know about additional WMI classes available:
http://msdn.microsoft.com/
---------------
'Add the following code to a module (called e.g. WMI)
Option Explicit
Private m_mainWmi As Object
Private m_deviceLists As Collection
Private Function GetMainWMIObject() As Object
On Error GoTo eh
If m_mainWmi Is Nothing Then
Set m_mainWmi = GetObject("WinMgmts:")
End If
Set GetMainWMIObject = m_mainWmi
Exit Function
eh:
Set GetMainWMIObject = Nothing
End Function
Public Function WmiIsAvailable() As Boolean
WmiIsAvailable = CBool(Not GetMainWMIObject Is Nothing)
End Function
Public Function GetWmiDeviceSingleValue(By
On Error GoTo done
Dim result As String
Dim wmiclassObjList As Object
Set wmiclassObjList = GetWmiDeviceList(WmiClass)
Dim wmiclassObj As Object
For Each wmiclassObj In wmiclassObjList
result = CallByName(wmiclassObj, WmiProperty, VbGet)
Exit For
Next
done:
GetWmiDeviceSingleValue = Trim(result)
End Function
Public Function GetWmiDeviceList(ByVal WmiClass As String) As Object
If m_deviceLists Is Nothing Then
Set m_deviceLists = New Collection
End If
On Error GoTo fetchNew
Set GetWmiDeviceList = m_deviceLists.Item(WmiClas
Exit Function
fetchNew:
Dim devList As Object
Set devList = GetWmiDeviceListInternal(W
If Not devList Is Nothing Then
Call m_deviceLists.Add(devList,
End If
Set GetWmiDeviceList = devList
End Function
Private Function GetWmiDeviceListInternal(B
On Error GoTo eh
Set GetWmiDeviceListInternal = GetMainWMIObject.Instances
Exit Function
eh:
Set GetWmiDeviceListInternal = Nothing
End Function
--------------------------
' then anywhere in your program you could write the fllowing to get the id:s
Dim CPU As String
CPU = GetWmiDeviceSingleValue("W
Dim BIOS As String
BIOS = GetWmiDeviceSingleValue("W
Business Accounts
Answer for Membership
by: VIMALCHANDPosted on 2005-05-23 at 00:36:10ID: 14058331
'paste in a form
sDrive As String) As Long e$ & ":\", sBuffer$, 255, lNumber&, 0&, 0&, sBuffer$, 255)
Private Sub Command1_Click()
MsgBox GetHardDiskSerial("C")
MsgBox GetVersion
End Sub
'paste in a module
Private Declare Function GetWindowsVersion Lib "kernel32" Alias "GetVersion" () As Long
Private Declare Function GetVolumeInformation& Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal pVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long)
Public Function GetVersion() As Long
On Error GoTo ErrTrap
GetVersion& = GetWindowsVersion&
Exit Function
ErrTrap:
GetVersion& = 0&
End Function
Public Function GetHardDiskSerial(Optional
On Error GoTo ErrTrap
Dim lNumber As Long, sBuffer As String * 255
If sDrive$ = "" Then sDrive$ = "C"
Call GetVolumeInformation(sDriv
GetHardDiskSerial& = lNumber&
Exit Function
ErrTrap:
Call MsgBox("Error " & Err.Number & ": " & Err.Description, vbOKOnly + vbCritical, "Error")
HardDiskSerial& = 0&
End Function