Jump to content

Get motherboard serial number


Gawish
 Share

Recommended Posts

Have you done any kind of search for this? I'm sure if you did, you'd probably find quite a few examples.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

i tried this code but it show pc name only

$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$colSMBIOS = $objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure")
For $objSMBIOS in $colSMBIOS
    ;ConsoleWrite("Serial Number: " & $objSMBIOS.SerialNumber & @CRLF)
    ;ConsoleWrite("Asset Tag: " & $objSMBIOS.SMBIOSAssetTag & @CRLF)
Next

#include <GUIConstants.au3>

GUICreate("System Information", 350, 100)  ; will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW)       ; will display an empty dialog box

GUICtrlCreateLabel("Serial #:", 15,10)
GUICtrlCreateInput($objSMBIOS.SerialNumber, 100, 10, 200, 20)

GUICtrlCreateLabel("Asset tag:", 15,40)
GUICtrlCreateInput($objSMBIOS.SMBIOSAssetTag, 100, 40, 200, 20)

GUICtrlCreateLabel("Computer name:", 15,70)
GUICtrlCreateInput(@ComputerName, 100, 70, 200, 20)

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Link to comment
Share on other sites

It doesnt show it for me either, have you looked in the bios and see if its actually set? a lot of manufacturers dont set it inside the bios as its written on the top of the mobo

Link to comment
Share on other sites

the code in this page didn't show anything

pls can u make it for me on my form

:lol:

The snippet from the page I linked does not write anything in the console?

Try with #RequireAdmin.

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

:lol:

The snippet from the page I linked does not write anything in the console?

Try with #RequireAdmin.

hey man im new in this field pls can u make it ?

and if u mean run it as admin i did that but nothing :(

Edited by Gawish
Link to comment
Share on other sites

  • Moderators

This works for me on a number of machines.

$WMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2")

$aBIOS = $WMI.ExecQuery("Select * from Win32_BIOS")

    For $element In $aBIOS
        MsgBox(0, "BIOS Info", _
        "Build Number: " & $element.BuildNumber & @CRLF & _
        "Current Language: " & $element.CurrentLanguage & @CRLF & _
        "Installable Languages: " & $element.InstallableLanguages & @CRLF & _
        "Manufacturer: " & $element.Manufacturer & @CRLF & _
        "Name: " & $element.Name & @CRLF & _
        "Primary BIOS: " & $element.PrimaryBIOS & @CRLF & _
        "Release Date: " & $element.ReleaseDate & @CRLF & _
        "Serial Number: " & $element.SerialNumber & @CRLF & _
        "SMBIOS Version: " & $element.SMBIOSBIOSVersion & @CRLF & _
        "SMBIOS Major Version: " & $element.SMBIOSMajorVersion & @CRLF & _
        "SMBIOS Minor Version: " & $element.SMBIOSMinorVersion & @CRLF & _
        "SMBIOS Present: " & $element.SMBIOSPresent & @CRLF & _
        "Status: " & $element.Status & @CRLF & _
        "Version: " & $element.Version)
    Next

@OP I will say that you will get more help around here if you actually put in some effort, rather than the "bro just do it for me" begging.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

This works for me on a number of machines.

$WMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2")

$aBIOS = $WMI.ExecQuery("Select * from Win32_BIOS")

    For $element In $aBIOS
        MsgBox(0, "BIOS Info", _
        "Build Number: " & $element.BuildNumber & @CRLF & _
        "Current Language: " & $element.CurrentLanguage & @CRLF & _
        "Installable Languages: " & $element.InstallableLanguages & @CRLF & _
        "Manufacturer: " & $element.Manufacturer & @CRLF & _
        "Name: " & $element.Name & @CRLF & _
        "Primary BIOS: " & $element.PrimaryBIOS & @CRLF & _
        "Release Date: " & $element.ReleaseDate & @CRLF & _
        "Serial Number: " & $element.SerialNumber & @CRLF & _
        "SMBIOS Version: " & $element.SMBIOSBIOSVersion & @CRLF & _
        "SMBIOS Major Version: " & $element.SMBIOSMajorVersion & @CRLF & _
        "SMBIOS Minor Version: " & $element.SMBIOSMinorVersion & @CRLF & _
        "SMBIOS Present: " & $element.SMBIOSPresent & @CRLF & _
        "Status: " & $element.Status & @CRLF & _
        "Version: " & $element.Version)
    Next

@OP I will say that you will get more help around here if you actually put in some effort, rather than the "bro just do it for me" begging.

it works but this information distinguishes a computer from others

Link to comment
Share on other sites

  • Moderators

it works but this information distinguishes a computer from others

 

No idea what this means, of course the serial number will distinguish the computer from others.

4OrWBy7T.png

i have win 8 x64

 

I don't have a win 8 box to test on, although I would point out that this is information that would have been useful at the beginning of this thread, instead of 15 posts later.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...