Results 1 to 3 of 3

Thread: API to get Floppy Disk Label/SN

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Is there an API call to get the label and/or serial number of a floppy disk?

    I want to write a program that will allow one click copying of floppies to a CD-RW. So while the program is running, I click the button, it copies my floppy to a folder named by the floppy label (or serial number if it doesn't have a label), when thats done I can pop out the floppy & copy another one. So I can sit there and backup lots of floppies easily.

    Thanks,
    Josh

  2. #2
    Guest
    To get the serial number, use the GetVolumeInformation api function.

    Code:
    Private Declare Function GetVolumeInformation Lib _
    "kernel32.dll" Alias "GetVolumeInformationA" (ByVal _
    lpRootPathName As String, ByVal lpVolumeNameBuffer As _
    String, ByVal nVolumeNameSize As Integer, _
    lpVolumeSerialNumber As Long, lpMaximumComponentLength _
    As Long, lpFileSystemFlags As Long, ByVal _
    lpFileSystemNameBuffer As String, ByVal _
    nFileSystemNameSize As Long) As Long       
    
    Function GetSerialNumber(strDrive As String) As Long
        Dim SerialNum As Long
        Dim Res As Long
        Dim Temp1 As String
        Dim Temp2 As String
        Temp1 = String$(255, Chr$(0))
        Temp2 = String$(255, Chr$(0))
        Res = GetVolumeInformation(strDrive, Temp1, _
        Len(Temp1), SerialNum, 0, 0, Temp2, Len(Temp2))
        GetSerialNumber = SerialNum
    End Function              
    
    Usage
    
    MsgBox GetSerialNumber("A:\")

  3. #3

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    It's the same one used for hard drives, right?

    I overlooked the obvious...
    Josh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width