Get firmware version of hard drive RRS feed

  • Question

  • Hello

    This code does a good job of getting the volume serial number of a hard drive but how can I get the firmware version of a hard drive?


    Private Declare Function GetVolumeSerialNumber Lib "kernel32.dll" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
    Public Function VolumeSerialNumber(ByVal RootPath As String) As String
        Dim VolLabel As String
        Dim VolSize As Long
        Dim Serial As Long
        Dim MaxLen As Long
        Dim Flags As Long
        Dim Name As String
        Dim NameSize As Long
        Dim s As String

        If GetVolumeSerialNumber(RootPath, VolLabel, VolSize, Serial, MaxLen, Flags, Name, NameSize) Then
            'Create an 8 character string
            s = Format(Hex(Serial), "00000000")
            'Adds the '-' between the first 4 characters and the last 4 characters
            VolumeSerialNumber = Left(s, 4) + "-" + Right(s, 4)
            'If the call to API function fails the function returns a zero serial number
            VolumeSerialNumber = "0000-0000"
        End If
    End Function

    Private Sub CommandButton1_Click()
        MsgBox VolumeSerialNumber("C:\") 'Shows the serial number of your Hard Disk
    End Sub


    • Moved by Bessie Zhao Monday, August 16, 2010 9:11 AM (From:Excel for Developers)
    Thursday, August 12, 2010 2:05 PM


All replies

  • Hello,

    Thanks for posting. This issue is off-topic in this forum. This forum is for the development issue of Office products. Sorry, I am not sure which forum is for this question. You could find an appropriate forum in forums home.

    Best regards,

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, August 16, 2010 8:38 AM
  • Hi Outrider

    I agree with Bessie that this is off-topic. The best place to find out where you can ask the question would be the "Where is the forum for..." forum. Unfortunately, I don't have the moderator permissions to move it to that place for you.

    Cindy Meister, VSTO/Word MVP
    Monday, August 16, 2010 9:09 AM
  • Hello

    Which would be a good forum for "Get firmware version of hard drive"

    Monday, August 16, 2010 1:44 PM
  • forums of firmware authors, e.g. or

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Monday, August 16, 2010 3:03 PM