Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Volume serial number

Status
Not open for further replies.

CCortez

Programmer
Sep 18, 2000
16
BR
Hi,
How to obtain the volume serial number of a hard disk?
May somebody help me ?
Thanks
 
#include <windows.h>
#include <stdio.h>

void main ( )
{ char VolumeName[20];
char FileSystemName[20];
DWORD SerialNo;
DWORD MaxComponentLength;
DWORD FileSystemFlags;
if ( !GetVolumeInformation ( &quot;C:\\&quot;, // or d: VolumeName,
sizeof ( VolumeName ),
&SerialNo,
&MaxComponentLength,
&FileSystemFlags,
FileSystemName,
sizeof ( FileSystemName ))
{ printf ( &quot;Error %d\n&quot;, GetlastError ( )); } else
{ printf ( &quot;Serial number is %d\n&quot;, SerialNo ); }
}


Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top