473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Serial Number

If anybody knows how in the management class we could get a computers serial
number that would be very helpful. I cannot seem to find the method.

Also in the hardware in your machine I can get the pieces but I am having
trouble with identifying numbers like serials or such. Does anyone have
ideas on this?
Nov 20 '05 #1
9 1667
Hi,

Add a reference to system.management.dll.

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_LogicalDisk where Name = 'C:'")

moReturn = moSearch.Get

For Each mo In moReturn

Dim VolumeName As String = mo("Name")

Dim SerialNumber As String = mo("Volumeserialnumber")

Dim strOut As String = String.Format("{0} - {1}", VolumeName, SerialNumber)

Debug.WriteLine(strOut)

Next

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_Processor")

moReturn = moSearch.Get

For Each mo In moReturn

Dim strout As String = String.Format("{0} - {1}", mo("Name"),
mo("ProcessorID"))

Debug.WriteLine(strout)

Next

Ken

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

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:u7**************@TK2MSFTNGP11.phx.gbl...
If anybody knows how in the management class we could get a computers
serial
number that would be very helpful. I cannot seem to find the method.

Also in the hardware in your machine I can get the pieces but I am having
trouble with identifying numbers like serials or such. Does anyone have
ideas on this?

Nov 20 '05 #2
* "scorpion53061" <Its the end of the world as we know it@here.com> scripsit:
If anybody knows how in the management class we could get a computers serial
number that would be very helpful. I cannot seem to find the method.


There is no "computer serial number". Which number do you exactly want
to deetermine?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Cor
Hi Scorpion,

The computer has maybe a serial number but it is nowhere as hardware.
(Only written on the back mostly)

The only thing I could think of is the serial number from the motherboard,
but that is also rare.

And therefore I think you cannot get a serial number from your management
system.

I hope this helps?

Cor

Also in the hardware in your machine I can get the pieces but I am having
trouble with identifying numbers like serials or such. Does anyone have
ideas on this?

Nov 20 '05 #4
> There is no "computer serial number". Which number do you exactly want
to deetermine?


you know the one on the back of the computer that is usually is printed on a
sticker........
Nov 20 '05 #5
> I hope this helps?

Well yes it did if it is in fact not possible :(.
Thanks Cor.

Those of us in the MIS business this is for many of us this is the fiscal
"year end" and we are required to do inventory reports. I will have to get
down on my hands and knees and pull the computer out and read it and
manually enter it.
Nov 20 '05 #6
Hi,

Windows Serial Number.

Dim MyReg As RegistryKey = Registry.LocalMachine

Dim MyRegKey As RegistryKey

Dim MyVal As String

MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion")

MyVal = MyRegKey.GetValue("ProductID")

MyRegKey.Close()

Ken

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

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eO****************@TK2MSFTNGP12.phx.gbl...
Hi,

Add a reference to system.management.dll.

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_LogicalDisk where Name = 'C:'")

moReturn = moSearch.Get

For Each mo In moReturn

Dim VolumeName As String = mo("Name")

Dim SerialNumber As String = mo("Volumeserialnumber")

Dim strOut As String = String.Format("{0} - {1}", VolumeName,
SerialNumber)

Debug.WriteLine(strOut)

Next

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_Processor")

moReturn = moSearch.Get

For Each mo In moReturn

Dim strout As String = String.Format("{0} - {1}", mo("Name"),
mo("ProcessorID"))

Debug.WriteLine(strout)

Next

Ken

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

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:u7**************@TK2MSFTNGP11.phx.gbl...
If anybody knows how in the management class we could get a computers
serial
number that would be very helpful. I cannot seem to find the method.

Also in the hardware in your machine I can get the pieces but I am having
trouble with identifying numbers like serials or such. Does anyone have
ideas on this?


Nov 20 '05 #7
Thank you Ken!!

I noticed the NT part.

Is there a way to do this for 98 and Me?

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl...
Hi,

Windows Serial Number.

Dim MyReg As RegistryKey = Registry.LocalMachine

Dim MyRegKey As RegistryKey

Dim MyVal As String

MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion")
MyVal = MyRegKey.GetValue("ProductID")

MyRegKey.Close()

Ken

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

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eO****************@TK2MSFTNGP12.phx.gbl...
Hi,

Add a reference to system.management.dll.

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_LogicalDisk where Name = 'C:'")

moReturn = moSearch.Get

For Each mo In moReturn

Dim VolumeName As String = mo("Name")

Dim SerialNumber As String = mo("Volumeserialnumber")

Dim strOut As String = String.Format("{0} - {1}", VolumeName,
SerialNumber)

Debug.WriteLine(strOut)

Next

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_Processor")

moReturn = moSearch.Get

For Each mo In moReturn

Dim strout As String = String.Format("{0} - {1}", mo("Name"),
mo("ProcessorID"))

Debug.WriteLine(strout)

Next

Ken

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

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in message news:u7**************@TK2MSFTNGP11.phx.gbl...
If anybody knows how in the management class we could get a computers
serial
number that would be very helpful. I cannot seem to find the method.

Also in the hardware in your machine I can get the pieces but I am having trouble with identifying numbers like serials or such. Does anyone have
ideas on this?



Nov 20 '05 #8
I think I would replace it with

MyRegKey = MyReg.OpenSubKey("SOFTWARE\Microsoft\Windows\Curre ntVersion")

but please correct me if I am wrong.

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Thank you Ken!!

I noticed the NT part.

Is there a way to do this for 98 and Me?

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl...
Hi,

Windows Serial Number.

Dim MyReg As RegistryKey = Registry.LocalMachine

Dim MyRegKey As RegistryKey

Dim MyVal As String

MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion")

MyVal = MyRegKey.GetValue("ProductID")

MyRegKey.Close()

Ken

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

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eO****************@TK2MSFTNGP12.phx.gbl...
Hi,

Add a reference to system.management.dll.

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_LogicalDisk where Name = 'C:'")

moReturn = moSearch.Get

For Each mo In moReturn

Dim VolumeName As String = mo("Name")

Dim SerialNumber As String = mo("Volumeserialnumber")

Dim strOut As String = String.Format("{0} - {1}", VolumeName,
SerialNumber)

Debug.WriteLine(strOut)

Next

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_Processor")

moReturn = moSearch.Get

For Each mo In moReturn

Dim strout As String = String.Format("{0} - {1}", mo("Name"),
mo("ProcessorID"))

Debug.WriteLine(strout)

Next

Ken

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

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:u7**************@TK2MSFTNGP11.phx.gbl...
> If anybody knows how in the management class we could get a computers
> serial
> number that would be very helpful. I cannot seem to find the method.
>
> Also in the hardware in your machine I can get the pieces but I am having> trouble with identifying numbers like serials or such. Does anyone

have> ideas on this?
>
>



Nov 20 '05 #9
Hi,

Think that is correct.
http://www.annoyances.org/exec/forum/win98/n1059073522
Ken
-----------------
"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:ui****************@TK2MSFTNGP12.phx.gbl...
I think I would replace it with

MyRegKey = MyReg.OpenSubKey("SOFTWARE\Microsoft\Windows\Curre ntVersion")

but please correct me if I am wrong.

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Thank you Ken!!

I noticed the NT part.

Is there a way to do this for 98 and Me?

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> Windows Serial Number.
>
> Dim MyReg As RegistryKey = Registry.LocalMachine
>
> Dim MyRegKey As RegistryKey
>
> Dim MyVal As String
>
> MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows

NT\currentVersion")
>
> MyVal = MyRegKey.GetValue("ProductID")
>
> MyRegKey.Close()
>
>
>
> Ken
>
> -------------------
>
> "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
> news:eO****************@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > Add a reference to system.management.dll.
> >
> > Dim moReturn As Management.ManagementObjectCollection
> >
> > Dim moSearch As Management.ManagementObjectSearcher
> >
> > Dim mo As Management.ManagementObject
> >
> > moSearch = New Management.ManagementObjectSearcher("Select * from
> > Win32_LogicalDisk where Name = 'C:'")
> >
> > moReturn = moSearch.Get
> >
> > For Each mo In moReturn
> >
> > Dim VolumeName As String = mo("Name")
> >
> > Dim SerialNumber As String = mo("Volumeserialnumber")
> >
> > Dim strOut As String = String.Format("{0} - {1}", VolumeName,
> > SerialNumber)
> >
> > Debug.WriteLine(strOut)
> >
> > Next
> >
> > moSearch = New Management.ManagementObjectSearcher("Select * from
> > Win32_Processor")
> >
> > moReturn = moSearch.Get
> >
> > For Each mo In moReturn
> >
> > Dim strout As String = String.Format("{0} - {1}", mo("Name"),
> > mo("ProcessorID"))
> >
> > Debug.WriteLine(strout)
> >
> > Next
> >
> >
> >
> > Ken
> >
> > -----------------------
> >
> > "scorpion53061" <Its the end of the world as we know it@here.com> wrote
in
> > message news:u7**************@TK2MSFTNGP11.phx.gbl...
> >> If anybody knows how in the management class we could get a
> >> computers
> >> serial
> >> number that would be very helpful. I cannot seem to find the method.
> >>
> >> Also in the hardware in your machine I can get the pieces but I am

having
> >> trouble with identifying numbers like serials or such. Does anyone

have > >> ideas on this?
> >>
> >>
> >
> >
>
>



Nov 20 '05 #10

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

Similar topics

21
by: Gavin | last post by:
Hi, I'm a newbie to programming of any kind. I have posted this to other groups in a hope to get a response from anyone. Can any one tell me how to make my VB program read the Bios serial number...
15
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
5
by: | last post by:
Hi, Do memory sticks have serial numbers like harddrives? If so how can I get this, I want to uniquely identify a memory stick (removable drive) for authentication. Thanks
79
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...
1
by: Darren DeCoste | last post by:
I am trying to create an application in Access that I will be able to print bar code labels. A stumbling block that I have hit is the Serial Number on the bar code. I would like to be able to read...
3
by: Stewart Allen | last post by:
Hi there I'm trying to find part serial numbers between 2 numbers. The user selects a part number from a combo box and then enters a range of serial numbers into 2 text boxes and the resulting...
3
by: Mark Harris | last post by:
I have an installer which uses a Customer Information page in it, is there an easy way to pass the serial number entered to a custom action? If not, where would i find the serial number in the...
14
by: Lauren Wilson | last post by:
Discovered this interesting comment on MSDN: "To programmatically obtain the hard disk's serial number that the manufacturer assigns, use the Windows Management Instrumentation (WMI)...
9
by: Nebojsa4 | last post by:
Hi. First, sorry on my weak English to all. Qusetion: How to read (in VB) Manufacturer serial number of Hard disk drive? Not volume/serial number of C:, D:, etc. partitons. For reading...
6
by: Paul Bromley | last post by:
Ok - I have given up on trying to find the active IP address for a given PC. For licensing purposes I need to retrive a unique identifier from the PC that the program is installed on. The Hard disk...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.