Results 1 to 7 of 7

Thread: diskette serial number

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Posts
    67

    diskette serial number

    does anyone know how get the serial number of a floppy disk??
    thanx
    AGB

  2. #2
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Using the EventVB.dll (downloadable from the Merrion Computing Website it can be done thus:

    Code:
    Option Explicit
    
    Dim WithEvents vbLink As EventVB.APIFunctions
    
    Private Sub Form_Load()
    
    Set vbLink = New EventVB.APIFunctions
    
    Dim volThis As ApiVolume
    
    For Each volThis In vbLink.System.Volumes
        Debug.Print volThis.RootName & " - " & volThis.SerialNumber
    Next volThis
    
    End Sub
    HTH,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Since when do diskettes have serial numbers?

  4. #4
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    If you do a DIR command in NT you get something like:


    Volume in drive A is LABELA
    Volume Serial Number is 0046-7A7B

    Directory of A:\


    etc.
    Every type of volume has a serial number which can be got with a call to GetVolumeInfo API call.

    HTH,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Well, there you have it!!! Who says you can't teach an old dog new tricks! I did not know that!

  6. #6
    Lively Member
    Join Date
    Jan 2002
    Posts
    74
    I tried this, but it doesn't come up with the right data.

    VB Code:
    1. Dim strBuffer As String
    2. Dim lngNameSize As Long
    3. Dim lngSerial As Long
    4. Dim lngMaxComp As Long
    5. Dim lngFlags As Long
    6. Dim strSystemNameBuffer As String
    7. Dim lngSystemNameSize As Long
    8.  
    9. GetVolumeInformation "c:\", strBuffer, lngNameSize, lngSerial, lngMaxComp, lngFlags, strSystemNameBuffer, lngSystemNameSize
    10.  
    11. MsgBox strBuffer & vbCrLf & Str(lngNameSize) & vbCrLf & Str(lngSerial) & vbCrLf & Str(lngMaxComp) & vbCrLf & Str(lngFlags) & vbCrLf & strSystemNameBuffer & vbCrLf & Str(lngSystemNameSize)

    According to the DLL-function, the serial should be a long, although the one you see in DOS-mode is eg. 4076-20A2. I assume it is a formatted hex-number. Seems to me, the function always spits up 255 as the serialnr.

    I am probably using it wrong

    Ideas?

  7. #7
    Lively Member
    Join Date
    Jan 2002
    Posts
    74
    Oopps!

    I was reading it wrong. It does work.
    Never mind

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