-
May 5th, 2005, 05:28 PM
#1
Thread Starter
New Member
How to get machine serial number?
Hi there, does anyone have any idea how to read the PC's serial number from the BIOS? Any help would be very much appreciated.
Just to clarify, I am talking about the hardware serial number of the PC itself, not (i repeat not) software keys of any description! We are building an asset list of our PCs and this information would help greatly
Many thanks in advance.
GC
-
May 5th, 2005, 07:15 PM
#2
Addicted Member
Re: How to get machine serial number?
Unscrew case... take off cover (or side depending on age of computer)
Retrieve flashlight from the junk drawer.. make sure flashlight batteries are charged by sticking battery to toungue.. (Warning kids dont try this at home)
Turn on flashlight... point flashlight at a 90 degree angle into pc case.. be carful not to shine in your eyes.
Look on board... for serial number.
LOL
Just joking. I dont know of any software to do it. You could try ASTTRA32 (advanced systemsinfo tool and reporting assistant)
can be downloaded for free @
http://www.astra32.com/download.htm
Try looking in the case as well it should have it in little white letters on the board. everything has a serial number. thats how they keep up with RMA's and such.
By mahine i would guess you mean motherboard/mainboard.
Hope that helped.
-
May 5th, 2005, 09:02 PM
#3
Re: How to get machine serial number?
How about setteling for the BIOS name and version?
Add a reference to System.Management as well as an imports statement.
VB Code:
Imports System.Management
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim query As New SelectQuery("Win32_bios")
Dim search As New ManagementObjectSearcher(query)
Dim info As ManagementObject
For Each info In search.Get()
Console.Writeline("Bios version: " & info("version").ToString())
Next
End Sub
End Class
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 6th, 2005, 04:54 AM
#4
Thread Starter
New Member
Re: How to get machine serial number?
I have added the System.Management reference but don't know what you meant by an import statment, I am sorry, I am really really new to .net and trying to learn as I go along.
Thanks in advance
-
May 6th, 2005, 04:56 AM
#5
Re: How to get machine serial number?
Damn you techwizz! I was just about to write a sarcastic post like that, you beat me to it
I don't live here any more.
-
May 6th, 2005, 10:52 AM
#6
Thread Starter
New Member
Re: How to get machine serial number?
Originally Posted by RobDog888
[color=navy]How about setteling for the BIOS name and version?
Add a reference to System.Management as well as an imports statement.
Hey man, thanks for this, I got it working. Changed out "version" for serialnumber and BINGO! as for the lifting the lid option, it's 160 PCs!!! hehehe thanks though
Thanks for your help guys, you are, as always a big bunch of stars!!
GC
-
May 6th, 2005, 11:11 AM
#7
PowerPoster
Re: How to get machine serial number?
Originally Posted by GusChops
Hey man, thanks for this, I got it working. Changed out "version" for serialnumber and BINGO! as for the lifting the lid option, it's 160 PCs!!! hehehe thanks though
Thanks for your help guys, you are, as always a big bunch of stars!!
GC
Hi,
Could you post your actual code please?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
May 6th, 2005, 11:14 AM
#8
Re: How to get machine serial number?
Post #3.
Change the line to this...
VB Code:
Console.Writeline("Bios version: " & info("version").ToString())
'Change to this:
Console.Writeline("Bios SN: " & info("serialnumber").ToString())
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 7th, 2005, 04:45 AM
#9
PowerPoster
Re: How to get machine serial number?
Hi,
Sorry to be a pest but that code gives me an error
I am using:
VB Code:
Dim query As New SelectQuery("Win32_bios")
Dim search As New ManagementObjectSearcher(query)
Dim info As ManagementObject
Dim sStr As String
For Each info In search.Get()
sStr = "Bios SN: " & info("serialnumber").ToString()
Next
The error is
Object reference not set to an instance of an object.
on the line
sStr = "Bios SN: " & info("serialnumber").ToString()
I tried amending
Dim info As ManagementObject
to
Dim info As New ManagementObject
but that made no difference.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
May 7th, 2005, 11:21 AM
#10
Re: How to get machine serial number?
I assume that you added the reference and Imports?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 7th, 2005, 02:45 PM
#11
PowerPoster
Re: How to get machine serial number?
Yes, Both reference & import. You don't get a problem with it? If you don't then I must have something affecting it.
If I replace "SerialNumber" with "Version" it works OK.
Next time I bootup I'll check the BIOS.
Last edited by taxes; May 7th, 2005 at 03:14 PM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
May 7th, 2005, 08:30 PM
#12
Re: How to get machine serial number?
I get "Bios SN: SYS-1234567890"
(notice that the numbers are 1-9+0)
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
-
May 7th, 2005, 08:41 PM
#13
Re: How to get machine serial number?
I got "To Be Filled By O.E.M." Running AMI Bios.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
May 7th, 2005, 09:54 PM
#14
-
Mar 15th, 2008, 03:33 AM
#15
Frenzied Member
Re: How to get machine serial number?
Sorry to refresh an ancient thread, but the code provided by RobDog888 doesn't work in VS2008. SelectQuery, ManagementObjectSearcher and ManagementObject don't exist. The only thing in System.Management is the namespace Instrumentation. Now, what do I do, since I have the same problem as the original author of this thread.
EDIT: Never mind, I fixed it.
Last edited by obi1kenobi; Mar 16th, 2008 at 05:17 AM.
Please rate helpful ppl's posts. It's the best 'thank you' you can give
-
Apr 6th, 2008, 09:24 PM
#16
Hyperactive Member
Re: How to get machine serial number?
sorry me too like obi1kenobi to revive this old thread....but i am facing a prob. with the same code....i am using vb2003 my code is
Code:
Dim query As New SelectQuery("Win32_bios")
Dim search As New ManagementObjectSearcher(query)
Dim info As ManagementObject
Dim mSrNo As String
For Each info In search.Get()
Console.WriteLine("Bios SN: " & info("serialnumber").ToString())
Next
i just get an output as
Bios SN: System Serial Number
an not the actual serial number....pls. help...i have added the ref. and the import statment..
thankx
-
Apr 9th, 2008, 06:55 AM
#17
Hyperactive Member
Re: How to get machine serial number?
hi guys.....anyone to help me out with this prob pls ?? would b obliged for ur help.
thankx a lot in advance
-
Apr 9th, 2008, 07:15 AM
#18
Lively Member
Re: How to get machine serial number?
Code:
Public Function SystemGUID() As String
Dim sGUID As String = ""
Dim objHDDSearcher As New System.Management.ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia")
For Each hardDrive As System.Management.ManagementObject In objHDDSearcher.Get()
On Error Resume Next
sGUID += hardDrive("SerialNumber").ToString
Next
Return sGUID.Trim
End Function
This is how I generate a system GUID by taking all of the HDD serial numbers. I figured by saying machine serial number you might possibly mean the hard drive serial number and that's how you get it.
Hope this helps.
-
Apr 9th, 2008, 07:20 AM
#19
Re: How to get machine serial number?
Check out the Hardware IDs link in my sig... with that class, you'll be able to get the motherboard Serial #, CPU Serial #, MAC Address of the primary ethernet controller and hard drive Serial #.
-
Apr 9th, 2008, 07:31 AM
#20
Hyperactive Member
Re: How to get machine serial number?
hi jenner thankx for the reply ...
i tried the post ...but it gives me MB-1234567890 but if i give dir in the command prompt and the Volume Serial no. that it shows is diffrent
i would want to display that particular serial no.
-
Apr 9th, 2008, 07:35 AM
#21
Hyperactive Member
Re: How to get machine serial number?
hey hey....thankx a ton jenner....i just read the entier post and got what i wanted....i just posted the reply a bit early....u have really been a help to me..
thankx a lot jenner...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|