473,386 Members | 1,763 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,386 software developers and data experts.

howto get harddisk serial number

tom
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
Jul 21 '05 #1
15 9602
You need to use WMI (System.Management) to query Win32_PhysicalDisk. Some
hard disks will not
give you a serial number (it might be null, so be prepared for that).
-mike
MVP

"tom" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
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


Jul 21 '05 #2
tom
Is there than a better way that allows me to uniquely
identify the pc where my software is running on that will
work always on any computer?

thanx,
t

-----Original Message-----
You need to use WMI (System.Management) to query Win32_PhysicalDisk. Somehard disks will not
give you a serial number (it might be null, so be prepared for that).-mike
MVP

"tom" <an*******@discussions.microsoft.com> wrote in messagenews:04****************************@phx.gbl...
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


.

Jul 21 '05 #3
Make a GUID per install or use WMI perhaps or SystemInformation class

"tom" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Is there than a better way that allows me to uniquely
identify the pc where my software is running on that will
work always on any computer?

thanx,
t

-----Original Message-----
You need to use WMI (System.Management) to query

Win32_PhysicalDisk. Some
hard disks will not
give you a serial number (it might be null, so be

prepared for that).
-mike
MVP

"tom" <an*******@discussions.microsoft.com> wrote in

message
news:04****************************@phx.gbl...
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


.

Jul 21 '05 #4
I have not found any Win32_PhysicalDisk.
I have found Win32_DiskDrive, but I do not find a property that returns the
physical drive serial number.
The DeviceID property returns values such as \\.\PHYSICALDRIVE2
Is there an example of how to get the physica drive serial number?

--
http://www.standards.com/; See Howard Kaikow's web site.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
You need to use WMI (System.Management) to query Win32_PhysicalDisk. Some
hard disks will not
give you a serial number (it might be null, so be prepared for that).
-mike
MVP

"tom" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
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


Jul 21 '05 #5
tom
An install guid identifies the source of my software not
the pc's it is running on. Neither does the
SystemInformation class provide me with a unique identity
of the pc. And since Michael pointed out that the hd
serial number is not always present I would like to know
a way that does identify the destination system and which
will work in every situation.

What I want to achieve is the following:
I want to distribute my software on cd. Through the
combination of the serial number of the cd and a unique
identifier of the system the software is installed on I
will be able to manage the licenses.
I was thinking that on my website I let users register
themselves (ie. enter cd sn and system identifier) where
they will get an encrypted key back of the combination of
cd sn and system identifier. The user would then get a
month after install to enter this encrypted key and if it
does not match the original values than my software would
not run..
-----Original Message-----
Make a GUID per install or use WMI perhaps or SystemInformation class
"tom" <an*******@discussions.microsoft.com> wrote in messagenews:04****************************@phx.gbl...
Is there than a better way that allows me to uniquely
identify the pc where my software is running on that will work always on any computer?

thanx,
t

>-----Original Message-----
>You need to use WMI (System.Management) to query

Win32_PhysicalDisk. Some
>hard disks will not
>give you a serial number (it might be null, so be

prepared for that).
>-mike
>MVP
>
>"tom" <an*******@discussions.microsoft.com> wrote in

message
>news:04****************************@phx.gbl...
>> 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
>
>
>
>.
>

.

Jul 21 '05 #6
Use a combination of IDs
"tom" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
An install guid identifies the source of my software not
the pc's it is running on. Neither does the
SystemInformation class provide me with a unique identity
of the pc. And since Michael pointed out that the hd
serial number is not always present I would like to know
a way that does identify the destination system and which
will work in every situation.

What I want to achieve is the following:
I want to distribute my software on cd. Through the
combination of the serial number of the cd and a unique
identifier of the system the software is installed on I
will be able to manage the licenses.
I was thinking that on my website I let users register
themselves (ie. enter cd sn and system identifier) where
they will get an encrypted key back of the combination of
cd sn and system identifier. The user would then get a
month after install to enter this encrypted key and if it
does not match the original values than my software would
not run..
-----Original Message-----
Make a GUID per install or use WMI perhaps or

SystemInformation class

"tom" <an*******@discussions.microsoft.com> wrote in

message
news:04****************************@phx.gbl...
Is there than a better way that allows me to uniquely
identify the pc where my software is running on that will work always on any computer?

thanx,
t
>-----Original Message-----
>You need to use WMI (System.Management) to query
Win32_PhysicalDisk. Some
>hard disks will not
>give you a serial number (it might be null, so be
prepared for that).
>-mike
>MVP
>
>"tom" <an*******@discussions.microsoft.com> wrote in
message
>news:04****************************@phx.gbl...
>> 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
>
>
>
>.
>

.

Jul 21 '05 #7
Why not use the componentmodel license classes and do it that way?
"tom" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
An install guid identifies the source of my software not
the pc's it is running on. Neither does the
SystemInformation class provide me with a unique identity
of the pc. And since Michael pointed out that the hd
serial number is not always present I would like to know
a way that does identify the destination system and which
will work in every situation.

What I want to achieve is the following:
I want to distribute my software on cd. Through the
combination of the serial number of the cd and a unique
identifier of the system the software is installed on I
will be able to manage the licenses.
I was thinking that on my website I let users register
themselves (ie. enter cd sn and system identifier) where
they will get an encrypted key back of the combination of
cd sn and system identifier. The user would then get a
month after install to enter this encrypted key and if it
does not match the original values than my software would
not run..
-----Original Message-----
Make a GUID per install or use WMI perhaps or

SystemInformation class

"tom" <an*******@discussions.microsoft.com> wrote in

message
news:04****************************@phx.gbl...
Is there than a better way that allows me to uniquely
identify the pc where my software is running on that will work always on any computer?

thanx,
t
>-----Original Message-----
>You need to use WMI (System.Management) to query
Win32_PhysicalDisk. Some
>hard disks will not
>give you a serial number (it might be null, so be
prepared for that).
>-mike
>MVP
>
>"tom" <an*******@discussions.microsoft.com> wrote in
message
>news:04****************************@phx.gbl...
>> 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
>
>
>
>.
>

.

Jul 21 '05 #8
Users dont like being tied to hardware. I know I dont, i hated that in the
unix world of CPU keying.


"tom" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
An install guid identifies the source of my software not
the pc's it is running on. Neither does the
SystemInformation class provide me with a unique identity
of the pc. And since Michael pointed out that the hd
serial number is not always present I would like to know
a way that does identify the destination system and which
will work in every situation.

What I want to achieve is the following:
I want to distribute my software on cd. Through the
combination of the serial number of the cd and a unique
identifier of the system the software is installed on I
will be able to manage the licenses.
I was thinking that on my website I let users register
themselves (ie. enter cd sn and system identifier) where
they will get an encrypted key back of the combination of
cd sn and system identifier. The user would then get a
month after install to enter this encrypted key and if it
does not match the original values than my software would
not run..
-----Original Message-----
Make a GUID per install or use WMI perhaps or

SystemInformation class

"tom" <an*******@discussions.microsoft.com> wrote in

message
news:04****************************@phx.gbl...
Is there than a better way that allows me to uniquely
identify the pc where my software is running on that will work always on any computer?

thanx,
t
>-----Original Message-----
>You need to use WMI (System.Management) to query
Win32_PhysicalDisk. Some
>hard disks will not
>give you a serial number (it might be null, so be
prepared for that).
>-mike
>MVP
>
>"tom" <an*******@discussions.microsoft.com> wrote in
message
>news:04****************************@phx.gbl...
>> 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
>
>
>
>.
>

.

Jul 21 '05 #9
The obligatory question , what if I change my hardware.

"tom" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
An install guid identifies the source of my software not
the pc's it is running on. Neither does the
SystemInformation class provide me with a unique identity
of the pc. And since Michael pointed out that the hd
serial number is not always present I would like to know
a way that does identify the destination system and which
will work in every situation.

What I want to achieve is the following:
I want to distribute my software on cd. Through the
combination of the serial number of the cd and a unique
identifier of the system the software is installed on I
will be able to manage the licenses.
I was thinking that on my website I let users register
themselves (ie. enter cd sn and system identifier) where
they will get an encrypted key back of the combination of
cd sn and system identifier. The user would then get a
month after install to enter this encrypted key and if it
does not match the original values than my software would
not run..
-----Original Message-----
Make a GUID per install or use WMI perhaps or

SystemInformation class

"tom" <an*******@discussions.microsoft.com> wrote in

message
news:04****************************@phx.gbl...
Is there than a better way that allows me to uniquely
identify the pc where my software is running on that will work always on any computer?

thanx,
t
>-----Original Message-----
>You need to use WMI (System.Management) to query
Win32_PhysicalDisk. Some
>hard disks will not
>give you a serial number (it might be null, so be
prepared for that).
>-mike
>MVP
>
>"tom" <an*******@discussions.microsoft.com> wrote in
message
>news:04****************************@phx.gbl...
>> 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
>
>
>
>.
>

.

Jul 21 '05 #10
I might have been off. Search for WMI Schema (or if you've found the docs
for Win32_DiskDrive, navigate up from there). Win32_BaseBoard has a serial
number. In other products, I use a combination of different IDs and then
hash them (so there's no identifying information). Some components have a
Tag or "OtherIdentifyingInfo" property. On my machine (Intel MB with P4
HT), all these were null except the baseboard (motherboard) serial.
-mike
MVP

"Howard Kaikow" <ka****@standards.com> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...
I have not found any Win32_PhysicalDisk.
I have found Win32_DiskDrive, but I do not find a property that returns the physical drive serial number.
The DeviceID property returns values such as \\.\PHYSICALDRIVE2
Is there an example of how to get the physica drive serial number?

--
http://www.standards.com/; See Howard Kaikow's web site.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
You need to use WMI (System.Management) to query Win32_PhysicalDisk. Some hard disks will not
give you a serial number (it might be null, so be prepared for that).
-mike
MVP

"tom" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
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



Jul 21 '05 #11
In Win32_DiskDrive, the following does not give the disk serial number:

DeviceID
Data type: string
Access type: Read-only
Qualifiers: Key

Unique identifier of the disk drive with other devices on the system. This
property is inherited from CIM_LogicalDevice

A bit over 2 years ago, I found an article in the Windows Media Format SDK
that might return the desired info.
I do not have a URL for the article.

The article states:
"Microsoft® Windows MediaT Device Manager uses a common way to retrieve the
serial number of a storage medium. For Windows NT, an SDMI-compliant reader
or adapter must respond to the following
IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER code, and return the data structure
MEDIA_SERIAL_NUMBER_DATA."

The example was given in C and I rarely use C, so I did not trey to convert
to VB.
--
http://www.standards.com/; See Howard Kaikow's web site.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:uH**************@tk2msftngp13.phx.gbl...
I might have been off. Search for WMI Schema (or if you've found the docs
for Win32_DiskDrive, navigate up from there). Win32_BaseBoard has a serial number. In other products, I use a combination of different IDs and then
hash them (so there's no identifying information). Some components have a
Tag or "OtherIdentifyingInfo" property. On my machine (Intel MB with P4
HT), all these were null except the baseboard (motherboard) serial.
-mike
MVP

"Howard Kaikow" <ka****@standards.com> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...
I have not found any Win32_PhysicalDisk.
I have found Win32_DiskDrive, but I do not find a property that returns

the
physical drive serial number.
The DeviceID property returns values such as \\.\PHYSICALDRIVE2
Is there an example of how to get the physica drive serial number?

--
http://www.standards.com/; See Howard Kaikow's web site.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
You need to use WMI (System.Management) to query Win32_PhysicalDisk. Some hard disks will not
give you a serial number (it might be null, so be prepared for that).
-mike
MVP

"tom" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
> 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



Jul 21 '05 #12
DeviceID is not the serial number. Look in the WMI schema to find other
things. As I said before, many devices might not report a serial. On my
Intel MB, it does report a serial (Win32_BaseBoard). Sometimes, there will
be asset tags and more. Of couse, this is always subject to change, and
nothing forces a vendor to put a unique serial on their hardware.

As for the Windows Media SDK, I don't know the details, but I see
SDMI-compliant. I think SDMI is one of those lame DRM protection schemes
that failed miserably. At any rate, all the devices would need to be
"compliant", and I'm sure many aren't (I think it was aimed at portable
storage?).

-mike
MVP
"Howard Kaikow" <ka****@standards.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
In Win32_DiskDrive, the following does not give the disk serial number:

DeviceID
Data type: string
Access type: Read-only
Qualifiers: Key

Unique identifier of the disk drive with other devices on the system. This
property is inherited from CIM_LogicalDevice

A bit over 2 years ago, I found an article in the Windows Media Format SDK
that might return the desired info.
I do not have a URL for the article.

The article states:
"Microsoft® Windows MediaT Device Manager uses a common way to retrieve the serial number of a storage medium. For Windows NT, an SDMI-compliant reader or adapter must respond to the following
IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER code, and return the data structure
MEDIA_SERIAL_NUMBER_DATA."

The example was given in C and I rarely use C, so I did not trey to convert to VB.
--
http://www.standards.com/; See Howard Kaikow's web site.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:uH**************@tk2msftngp13.phx.gbl...
I might have been off. Search for WMI Schema (or if you've found the docs for Win32_DiskDrive, navigate up from there). Win32_BaseBoard has a

serial
number. In other products, I use a combination of different IDs and then hash them (so there's no identifying information). Some components have a Tag or "OtherIdentifyingInfo" property. On my machine (Intel MB with P4
HT), all these were null except the baseboard (motherboard) serial.
-mike
MVP

"Howard Kaikow" <ka****@standards.com> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...
I have not found any Win32_PhysicalDisk.
I have found Win32_DiskDrive, but I do not find a property that returns
the
physical drive serial number.
The DeviceID property returns values such as \\.\PHYSICALDRIVE2
Is there an example of how to get the physica drive serial number?

--
http://www.standards.com/; See Howard Kaikow's web site.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
> You need to use WMI (System.Management) to query Win32_PhysicalDisk.

Some
> hard disks will not
> give you a serial number (it might be null, so be prepared for

that). > -mike
> MVP
>
> "tom" <an*******@discussions.microsoft.com> wrote in message
> news:04****************************@phx.gbl...
> > 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
>
>
>



Jul 21 '05 #13
"anonymouse" <an********@discussions.microsoft.com> wrote in
news:uQ**************@TK2MSFTNGP09.phx.gbl:
The obligatory question , what if I change my hardware.


A change in hardware could easily be a new computer. How is the software
suposed to know? The key is for the licensing to offer a little
flexibility in how many times or how often a given CD key can be used to
install the software.

In this model a web connection handles all the details. All the user has
to do is run a quick wizard once per install (or per major hardware
change). If they don't have the web then they can call in for a code.

As far as the implementation it's all about web services. Just create a
web service that takes a machine config, and returns a code. As far as
what to use for "machine config" I'm not entirely sure. Others seem to
have given good answers for that.
Windows XP licensing seems to work well. It is tied to the hardware. It
let's you change your hardware a little before you need to reactivate. In
either case, you can change the hardware all you want and still not have to
pay for it again. I 'think' the break point is that you can only reinstall
to a new set of hardware once every 6 months before a red flag is raised.
However it still installs and activates.

Michael Lang, MCSD
Jul 21 '05 #14
I did not ask for other things.

I was just pointing out things that I had found that might provide the
"serial number".

Obviously, there must be some way to do this as there are programs from disk
drive vendors that report the info on their own, and often other, drives.

So somewhere, such an interface is provided.

I just do not know where it is "documented".
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:u%****************@TK2MSFTNGP10.phx.gbl...
DeviceID is not the serial number. Look in the WMI schema to find other
things. As I said before, many devices might not report a serial. On my
Intel MB, it does report a serial (Win32_BaseBoard). Sometimes, there will be asset tags and more. Of couse, this is always subject to change, and
nothing forces a vendor to put a unique serial on their hardware.

As for the Windows Media SDK, I don't know the details, but I see
SDMI-compliant. I think SDMI is one of those lame DRM protection schemes
that failed miserably. At any rate, all the devices would need to be
"compliant", and I'm sure many aren't (I think it was aimed at portable
storage?).

-mike
MVP
"Howard Kaikow" <ka****@standards.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
In Win32_DiskDrive, the following does not give the disk serial number:

DeviceID
Data type: string
Access type: Read-only
Qualifiers: Key

Unique identifier of the disk drive with other devices on the system. This
property is inherited from CIM_LogicalDevice

A bit over 2 years ago, I found an article in the Windows Media Format SDK that might return the desired info.
I do not have a URL for the article.

The article states:
"Microsoft® Windows MediaT Device Manager uses a common way to retrieve the
serial number of a storage medium. For Windows NT, an SDMI-compliant

reader
or adapter must respond to the following
IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER code, and return the data structure MEDIA_SERIAL_NUMBER_DATA."

The example was given in C and I rarely use C, so I did not trey to

convert
to VB.
--
http://www.standards.com/; See Howard Kaikow's web site.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:uH**************@tk2msftngp13.phx.gbl...
I might have been off. Search for WMI Schema (or if you've found the

docs for Win32_DiskDrive, navigate up from there). Win32_BaseBoard has a

serial
number. In other products, I use a combination of different IDs and then hash them (so there's no identifying information). Some components have a
Tag or "OtherIdentifyingInfo" property. On my machine (Intel MB with
P4 HT), all these were null except the baseboard (motherboard) serial.
-mike
MVP

"Howard Kaikow" <ka****@standards.com> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...
> I have not found any Win32_PhysicalDisk.
> I have found Win32_DiskDrive, but I do not find a property that

returns the
> physical drive serial number.
> The DeviceID property returns values such as \\.\PHYSICALDRIVE2
> Is there an example of how to get the physica drive serial number?
>
> --
> http://www.standards.com/; See Howard Kaikow's web site.
> "Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
> news:Ox**************@TK2MSFTNGP12.phx.gbl...
> > You need to use WMI (System.Management) to query Win32_PhysicalDisk. Some
> > hard disks will not
> > give you a serial number (it might be null, so be prepared for that). > > -mike
> > MVP
> >
> > "tom" <an*******@discussions.microsoft.com> wrote in message
> > news:04****************************@phx.gbl...
> > > 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
> >
> >
> >
>
>



Jul 21 '05 #15
Well, if you find one of those programs, open it up in a dissassembler and
see what calls it makes. Also be aware that they might use device-specific
APIs.
-mike
MVP

"Howard Kaikow" <ka****@standards.com> wrote in message
news:Oy**************@TK2MSFTNGP11.phx.gbl...
I did not ask for other things.

I was just pointing out things that I had found that might provide the
"serial number".

Obviously, there must be some way to do this as there are programs from disk drive vendors that report the info on their own, and often other, drives.

So somewhere, such an interface is provided.

I just do not know where it is "documented".
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:u%****************@TK2MSFTNGP10.phx.gbl...
DeviceID is not the serial number. Look in the WMI schema to find other
things. As I said before, many devices might not report a serial. On my
Intel MB, it does report a serial (Win32_BaseBoard). Sometimes, there will
be asset tags and more. Of couse, this is always subject to change, and
nothing forces a vendor to put a unique serial on their hardware.

As for the Windows Media SDK, I don't know the details, but I see
SDMI-compliant. I think SDMI is one of those lame DRM protection schemes that failed miserably. At any rate, all the devices would need to be
"compliant", and I'm sure many aren't (I think it was aimed at portable
storage?).

-mike
MVP
"Howard Kaikow" <ka****@standards.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
In Win32_DiskDrive, the following does not give the disk serial number:
DeviceID
Data type: string
Access type: Read-only
Qualifiers: Key

Unique identifier of the disk drive with other devices on the system. This property is inherited from CIM_LogicalDevice

A bit over 2 years ago, I found an article in the Windows Media Format SDK that might return the desired info.
I do not have a URL for the article.

The article states:
"Microsoft® Windows MediaT Device Manager uses a common way to retrieve the
serial number of a storage medium. For Windows NT, an SDMI-compliant

reader
or adapter must respond to the following
IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER code, and return the data structure MEDIA_SERIAL_NUMBER_DATA."

The example was given in C and I rarely use C, so I did not trey to

convert
to VB.
--
http://www.standards.com/; See Howard Kaikow's web site.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:uH**************@tk2msftngp13.phx.gbl...
> I might have been off. Search for WMI Schema (or if you've found
the
docs
> for Win32_DiskDrive, navigate up from there). Win32_BaseBoard has a
serial
> number. In other products, I use a combination of different IDs and

then
> hash them (so there's no identifying information). Some components

have
a
> Tag or "OtherIdentifyingInfo" property. On my machine (Intel MB

with P4 > HT), all these were null except the baseboard (motherboard) serial.
> -mike
> MVP
>
> "Howard Kaikow" <ka****@standards.com> wrote in message
> news:e5**************@TK2MSFTNGP10.phx.gbl...
> > I have not found any Win32_PhysicalDisk.
> > I have found Win32_DiskDrive, but I do not find a property that

returns
> the
> > physical drive serial number.
> > The DeviceID property returns values such as \\.\PHYSICALDRIVE2
> > Is there an example of how to get the physica drive serial number?
> >
> > --
> > http://www.standards.com/; See Howard Kaikow's web site.
> > "Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in
message > > news:Ox**************@TK2MSFTNGP12.phx.gbl...
> > > You need to use WMI (System.Management) to query

Win32_PhysicalDisk. > Some
> > > hard disks will not
> > > give you a serial number (it might be null, so be prepared for

that).
> > > -mike
> > > MVP
> > >
> > > "tom" <an*******@discussions.microsoft.com> wrote in message
> > > news:04****************************@phx.gbl...
> > > > 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
> > >
> > >
> > >
> >
> >
>
>



Jul 21 '05 #16

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

Similar topics

1
by: jewelin | last post by:
I'd tried to retrieve the ID or Serial Number of main-board and hard-disk via WMI using C#, but failed. One friend suggested me with some codes calling WIN32 API, but only effective on WIN2000...
1
by: Arif Çimen | last post by:
Hi everybody I need to get serial number of harddist drive (C:\). Here I tried some codes. //************** using System; using System.Runtime.InteropServices;
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
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...

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.