Hard disk serial number info 
Author Message
 Hard disk serial number info

Hi there,

I would like some information on how to obtain the serial number of a hard
disk under windows, with visual C/C++ 1.52 or 4.00. I know it is possible
under DOS using interrupt 21, function 69h but this doesn't work under
windows.

Send any help to:



Sun, 01 Aug 1999 03:00:00 GMT  
 Hard disk serial number info

Hi Bart,

<<
I would like some information on how to obtain the serial number of a hard
disk under windows, with visual C/C++ 1.52 or 4.00. I know it is possible
under DOS using interrupt 21, function 69h but this doesn't work under
windows.

You can use the GetVolumeInformation function for this. For example, the
following piece of code gives you a message box with the same info that
typing 'vol' at the command prompt would - the volume label and the volume
serial number.

[CODE]
char szTemp[101];
char szVolName[51];
DWORD dwVolSerialNum;

GetVolumeInformation("c:\\",szVolName,50,&dwVolSerialNum,NULL,NULL,NULL,0);
wsprintf(szTemp,"Vol Name : %s ; Vol Ser : %x",szVolName,dwVolSerialNum);
MessageBox(NULL,szTemp,"Volume Info",MB_OK);

[CODE ENDS]

If you check out the on-line help on GetVolumeInformation, you'll find that
you can also retrieve the file system name, the max filename length under
the
file system and info about whether the volume is compressed, preservation of
case in filenames and so on. I've left out all that because you'd asked
about
the serial number only.

The command prompt 'vol' gives the serial number in hex. That's why I've
used
a %x in the wsprintf.

I hope this solves your problem.

Krishnan

Aditi Corp.

 Aditi Corp was formerly known as NetQuest Inc.



Mon, 02 Aug 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Hard disk serial number. Please help

2. Determining the serial number on a hard disk

3. Hard disk's serial number

4. How can I get Hard Disk Serial Number?

5. Hard disk serial number

6. Reading Hard Disk Serial Number

7. getting the hard disk serial number

8. How to get Hard Disk Serial Number

9. Obtaining Hard Disk Serial Number

10. serial number a motherboard or hard disk or processor

11. Getting Hard Disk Serial Number

12. HARD DISK serial number

 

 
Powered by phpBB® Forum Software