Results 1 to 3 of 3

Thread: GetVolumeInformation API

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 1999
    Location
    MONTEVIDEO, URUGUAY
    Posts
    15

    Post

    I posted a topic today with wrong information. The problem is that I use GetVolumeInformation with W95, but it does not run in Windows NT.

    Anybody can help me to get the disk serial number runing in NT?

    Marty, if you this message, I apologize for my error.

    Thanks in advance

    Ruben

  2. #2

    Thread Starter
    New Member
    Join Date
    Sep 1999
    Location
    MONTEVIDEO, URUGUAY
    Posts
    15

    Post

    Nobody can help me?

    There is not form of knowing the disk serial number in NT?

    Ruben

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    It works just fine on WinNT:
    Code:
    Private Declare Function GetVolumeInformation Lib "kernel32" 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 GetDiskSerialNumber(pstrDisk As String) As Long
        Dim lRet As Long
        Dim lUnused1 As Long
        Dim lUnused2 As Long
        Dim strUnused1 As String
        Dim strUnused2 As String
         
        lRet = GetVolumeInformation(pstrDisk, strUnused1, Len(strUnused1), GetDiskSerialNumber, 0, 0, strUnused2, Len(strUnused2))
    End Function
    Example: MsgBox GetDiskSerialNumber("C:")


    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819


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