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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading a floppy serial number... 1

Status
Not open for further replies.

Elliott3

Programmer
Sep 5, 2002
347
CA
Hi,
Can someone tell me how to read the serial number of a floppy disk?

CES
 
Hi Elliot,

This uses MFC but you can adjust it for your needs

[tt]CString serial;
char vol_name[128];
DWORD serialNum = 0x0;
DWORD data = MAX_PATH*sizeof(TCHAR);

if(GetVolumeInformation("A:\\",vol_name,sizeof(vol_name),
&serialNum,&data,NULL,NULL,NULL))
{
serial.Format("%x", serialNum);
}[/tt]

tellis.gif

programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.
 
Hi qednick,
Thanks for the info.
Do you know why 6 out of 9 disks I tried returned zero (0)?

CES
 
All floppy disks do have a serial number....don't they?

CES
 
Well I always thought so - I'll give it a try and see what happens.
tellis.gif

programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.
 
I tried it with several floppy disks and they all successfully returned the volume name and serial. I don't have any unformatted disks to hand to see what happens in that case.
Were all your disks formatted and labelled? Perhaps the ones that didn't work were formatted but not labelled or something like that? Other than that nothing obvious springs to mind.

:-(
tellis.gif

programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.
 
Thanks qednick.
None of my disks were labelled, so I labeled one to see if it would change anything but no luck, the serial number is still zero. Anyhow, I will just have to label the disks and get the label with the method you have suggested.
Thanks again for your help.

CES
 
No probs Elliot, floppy disks are not the most reliable of media at the best of times. Perhaps a different brand will help.

:)
tellis.gif

programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top