interface
function GetSerialNumber(const PathName: string): string;
implementation
function GetSerialNumber(const PathName: string): string;
var
SN, MCL, FSF: DWORD;
begin {GetSerialNumber}
if GetVolumeInformation(PChar(PathName), nil, 0, @SN, MCL, FSF, nil, 0) then
Result := Format('%x-%x', [LongRec(SN).Hi, LongRec(SN).Lo])
else
Result := '';
end;
delphi.about.com