By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,870 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,870 IT Pros & Developers. It's quick & easy.

howto get harddisk serial number

P: n/a
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
Share this Question
Share on Google+
15 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.