Disk serial number

There is some ways to find out the hard disk serial number? And if yes, how? Maybe with a Win NT API or some MFC funcs?
Thans to everyone.
pFaz69Asked:
Who is Participating?
 
nietodConnect With a Mentor Commented:
Hard disks don't necessisarily have a serial number and don't necessarily provide any mechanism for obtaining it from the software.  (Just because its stamped on the outside doesn't mean the computer can learn about it).  But many manufacturers do provide a serial number, but how that is obtained depends on the manufacturer, so writting a generic device driver to obtain it from any manufacturer can be a big challenge.  There was one posted a few months ago but the client who got it said it didn't work at all, and I'm not surprised.

You can use GetVolumeInformation() to get a volume number for a volume on a drive, but this is not the same thing.
0
 
pFaz69Author Commented:
Thanks i meant.
0
 
dhymesCommented:
You can find some some sample source code at the following URL.


http://www.programmersheaven.com/zone3/cat35/1859.htm

Hope this helps
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
dhymesCommented:
O, and when you get there you will need to look for a file called dugide10.zip. This file will show you exactly how do what you need.

Regards,
Dave
0
 
pFaz69Author Commented:
the page has been moved and i can't find dugide10.zip
0
 
pFaz69Author Commented:
OK i found it. That would be exactly what i was looking for, but unluckily it doesn't work.
0
 
dhymesCommented:
Ok, but why does it not work?
0
 
pFaz69Author Commented:
dhymes, i don't know why it doesn't work: i just double-clicked on exe and the program terminates telling me nothing. I also looked at the code and i saw what the program is suppoosed to do, but it ends before.
0
 
dhymesCommented:
I would recommend writing a stub program, then compile and run the program through your debugger and find out what statement is failing.

Dave
0
 
pFaz69Author Commented:
in VC++ i can't compile it; the header <bios.h> doesn't exist
0
 
pFaz69Author Commented:
nietod, maybe we didn't understand perfectly each other, but anyway GetVolumeInformation() is good.
0
 
nietodCommented:
I'm not sure what wasn't understood.  But GetVolumneInformation() is rarely what people want (that's why I didn't answer).  The volumne number is not like a serial number.  It is not "set in stoine".  The user can change it for example.  Also there may be more than one volume per drive.
0
All Courses

From novice to tech pro — start learning today.