473,836 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieving a system serial number...

Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!
Nov 21 '05 #1
10 14998
Maybe you can use the serialnumber from the next api-call:
Private Declare Function GetVolumeInform ation Lib "Kernel32" Alias
"GetVolumeInfor mationA" (ByVal lpRootPathName As String, ByVal
lpVolumeNameBuf fer As String, ByVal nVolumeNameSize As Long,
lpVolumeSerialN umber As Long, lpMaximumCompon entLength As Long,
lpFileSystemFla gs As Long, ByVal lpFileSystemNam eBuffer As String, ByVal
nFileSystemName Size As Long) As Long

"Terry Olsen" <to******@hotma il.com> wrote in message
news:Oa******** ******@TK2MSFTN GP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #2
Terry,

There is not a real serial number, there is sometimes a processor number and
with a computer connected to a LAN or whatever that uses a network adapter,
a Mac address, and probably more numbers, however as far as I have seen not
an always existing unique one.

You can find those starting reading here reading (after that a is a little
sample in this message).

http://msdn.microsoft.com/library/de...Management.asp

http://msdn.microsoft.com/library/de...classtopic.asp

It are a lot of collections in collections.

I have not at the moment a sample at hand for those numbers, however see
this sample how to get drive information. I do not know where I got it
anymore.

\\\Add a reference to "System.Managem ent.dll".
Dim disk As New ManagementObjec t( _
"Win32_LogicalD isk.DeviceID="" C:""" )
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLi ne( _
"{0} = {1}", _
diskProperty.Na me,
diskProperty.Va lue )
Next diskProperty
///

I hope this helps?

Cor


"Terry Olsen" <to******@hotma il.com> schreef in bericht
news:Oa******** ******@TK2MSFTN GP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #3
Maybe you can use the serialnumber from the next api-call:
Private Declare Function GetVolumeInform ation Lib "Kernel32" Alias
"GetVolumeInfor mationA" (ByVal lpRootPathName As String, ByVal
lpVolumeNameBuf fer As String, ByVal nVolumeNameSize As Long,
lpVolumeSerialN umber As Long, lpMaximumCompon entLength As Long,
lpFileSystemFla gs As Long, ByVal lpFileSystemNam eBuffer As String, ByVal
nFileSystemName Size As Long) As Long

"Terry Olsen" <to******@hotma il.com> wrote in message
news:Oa******** ******@TK2MSFTN GP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #4
Hi,

Windows serial number

Dim myReg As RegistryKey = Registry.LocalM achine

Dim MyRegKey As RegistryKey

Dim MyVal As String

MyRegKey = myReg.OpenSubKe y("Software\Mic rosoft\Windows NT\CurrentVersi on")

MyVal = MyRegKey.GetVal ue("ProductID" )

MyRegKey.Close( )

Ken

---------------------------------

"Terry Olsen" <to******@hotma il.com> wrote in message
news:Oa******** ******@TK2MSFTN GP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #5
Hi,

Windows serial number

Dim myReg As RegistryKey = Registry.LocalM achine

Dim MyRegKey As RegistryKey

Dim MyVal As String

MyRegKey = myReg.OpenSubKe y("Software\Mic rosoft\Windows NT\CurrentVersi on")

MyVal = MyRegKey.GetVal ue("ProductID" )

MyRegKey.Close( )

Ken

---------------------------------

"Terry Olsen" <to******@hotma il.com> wrote in message
news:Oa******** ******@TK2MSFTN GP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #6
We use HP/Compaq & IBM machines. Belarc Advisor is able to show the system
serial number of these machines (matches the serial number the vendor puts
on the nameplate). That's what I'm wanting to figure out how to grab...
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Terry,

There is not a real serial number, there is sometimes a processor number
and with a computer connected to a LAN or whatever that uses a network
adapter, a Mac address, and probably more numbers, however as far as I
have seen not an always existing unique one.

You can find those starting reading here reading (after that a is a
little sample in this message).

http://msdn.microsoft.com/library/de...Management.asp

http://msdn.microsoft.com/library/de...classtopic.asp

It are a lot of collections in collections.

I have not at the moment a sample at hand for those numbers, however see
this sample how to get drive information. I do not know where I got it
anymore.

\\\Add a reference to "System.Managem ent.dll".
Dim disk As New ManagementObjec t( _
"Win32_LogicalD isk.DeviceID="" C:""" )
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLi ne( _
"{0} = {1}", _
diskProperty.Na me,
diskProperty.Va lue )
Next diskProperty
///

I hope this helps?

Cor


"Terry Olsen" <to******@hotma il.com> schreef in bericht
news:Oa******** ******@TK2MSFTN GP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing
an auditing program and need to grab that little bit of info.

Thanks!


Nov 21 '05 #7
We use HP/Compaq & IBM machines. Belarc Advisor is able to show the system
serial number of these machines (matches the serial number the vendor puts
on the nameplate). That's what I'm wanting to figure out how to grab...
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Terry,

There is not a real serial number, there is sometimes a processor number
and with a computer connected to a LAN or whatever that uses a network
adapter, a Mac address, and probably more numbers, however as far as I
have seen not an always existing unique one.

You can find those starting reading here reading (after that a is a
little sample in this message).

http://msdn.microsoft.com/library/de...Management.asp

http://msdn.microsoft.com/library/de...classtopic.asp

It are a lot of collections in collections.

I have not at the moment a sample at hand for those numbers, however see
this sample how to get drive information. I do not know where I got it
anymore.

\\\Add a reference to "System.Managem ent.dll".
Dim disk As New ManagementObjec t( _
"Win32_LogicalD isk.DeviceID="" C:""" )
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLi ne( _
"{0} = {1}", _
diskProperty.Na me,
diskProperty.Va lue )
Next diskProperty
///

I hope this helps?

Cor


"Terry Olsen" <to******@hotma il.com> schreef in bericht
news:Oa******** ******@TK2MSFTN GP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing
an auditing program and need to grab that little bit of info.

Thanks!


Nov 21 '05 #8
Terry,

I almost forgot to answer you, using the links I showed you and the code
you can use boards, baseboard, serialnumber, than you get the serialnumer of
the baseboard, I do not know if that is the number what is as well what is
at the back of your computers. However the information you can get is so
immense, it is impossible to tell you what it is what without trying.

I hope this helps?

Cor

"Terry Olsen" <to******@hotma il.com> ..
We use HP/Compaq & IBM machines. Belarc Advisor is able to show the
system serial number of these machines (matches the serial number the
vendor puts on the nameplate). That's what I'm wanting to figure out how
to grab...
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Terry,

There is not a real serial number, there is sometimes a processor number
and with a computer connected to a LAN or whatever that uses a network
adapter, a Mac address, and probably more numbers, however as far as I
have seen not an always existing unique one.

You can find those starting reading here reading (after that a is a
little sample in this message).

http://msdn.microsoft.com/library/de...Management.asp

http://msdn.microsoft.com/library/de...classtopic.asp

It are a lot of collections in collections.

I have not at the moment a sample at hand for those numbers, however see
this sample how to get drive information. I do not know where I got it
anymore.

\\\Add a reference to "System.Managem ent.dll".
Dim disk As New ManagementObjec t( _
"Win32_LogicalD isk.DeviceID="" C:""" )
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLi ne( _
"{0} = {1}", _
diskProperty.Na me,
diskProperty.Va lue )
Next diskProperty
///

I hope this helps?

Cor


"Terry Olsen" <to******@hotma il.com> schreef in bericht
news:Oa******** ******@TK2MSFTN GP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing
an auditing program and need to grab that little bit of info.

Thanks!



Nov 21 '05 #9
I think I found what I need to get the serial number. It's in the
Win32_BaseBoard WMI Class. Now I need help on how to use it. I tried
this:

Dim w32bb As New ManagementObjec t("Win32_BaseBo ard")

But that give me an exception "specified argument was out of the range
of valid values"

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
9699
by: tom | last post by:
Hi, How do I get the serial number of the harddisk in .NET? I want this to be the same number even if the user has reformatted, so I do not want the volume serial number. Thanx, t
79
14133
by: Klaus Bonadt | last post by:
In order to protect software from being copied without licence, I would like to use something like a key, which fits only to the current system. The serial number of the CPU or the current operating system would be appropriate. However, I do not know how to retrieve the information. Could you help? Klaus
1
315
by: Terry Olsen | last post by:
Does anyone know how to retrieve the system serial number? I'm writing an auditing program and need to grab that little bit of info. Thanks!
0
1268
by: steinerh | last post by:
Hi, I am using FSO (VB6.0 proff) to retrieve the serial number of my hardisk. Comparing the number with what WIN XP returns and also what I retrieve using the dir command in DOS is really diverging. VB6.0 using FSO returns: HDserial# = 1894436341 WIN XP shows: WDC WD800JD-08LSA0 DOS (using the top header info of the DIR listing) returns: 70EA-CDF5 Now, what is right and what is wrong ? Help greatly appreciated
0
4967
Airslash
by: Airslash | last post by:
Hello, I've written a class that resembles a hard drive. I'm already able using the Windows API to get information such as the remaining free bytes, the sectors and clusters,a nd it all works fine. The last step that I need is to obtain the serial number of the harddrive in question. From what I can understand in the MSDN library you need to take into account that a Volume can span multiple disks etc, but I don't wanne waste time on that...
0
9656
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10819
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10526
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10567
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10237
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6972
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5641
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3100
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.