Motherboard Serial Number

Motherboard Serial Number

Postby Jeff Barnes » Fri Feb 23, 2007 6:56 pm

Hi Everybody,

Anyone know how to read the serial number of a motherboard?

Thanks,
Jeff
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Jeff Barnes » Fri Feb 23, 2007 9:42 pm

I found some VB code that should get the Motherboard Serial number.

Can anyone convert this to FWH ?


Jeff

Code: Select all  Expand view
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
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Enrico Maria Giordano » Fri Feb 23, 2007 11:58 pm

Code: Select all  Expand view
FUNCTION MAIN()

    LOCAL oLoc := CREATEOBJECT( "wbemScripting.SwbemLocator" )
    LOCAL oSrv := oLoc:ConnectServer()
    LOCAL oJbs := oSrv:ExecQuery( "SELECT * FROM Win32_BaseBoard" )

    LOCAL oJob

    FOR EACH oJob IN oJbs
        ? oJob:SerialNumber
    NEXT

    RETURN NIL
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Jeff Barnes » Sat Feb 24, 2007 2:03 am

Once again many thanks. :D


Jeff
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby RAMESHBABU » Sat Feb 24, 2007 3:08 am

Hi

"wbemScripting.SwbemLocator" object is available where ?

Is is available in Win98 also ?

Thanks

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby Enrico Maria Giordano » Sat Feb 24, 2007 9:49 am

It should be available. From MSDN:

Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0 SP4 and later, Windows Me, Windows 98, or Windows 95 OSR2 and later.
Server Requires Windows Server "Longhorn", Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0 SP4 and later.
Type Library Use Wbemdisp.tlb.

DLL Requires Wbemdisp.dll.


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests