Results 1 to 4 of 4

Thread: Retrieving info from the system

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Location
    Beverwijk, Holland
    Posts
    14
    I want to extract the following information from the system:

    *Windows build
    *the volume number of the harddisk

    Does anybody know how to do this?
    Live Long and Prosper,

    Leo Schelvis
    [ECH]

    VB6

  2. #2
    Guest

    Talking

    Try this for the volume information. I have one for
    the windows build somewhere but I can't locate it!


    API for module or whatever:


    Private Const MAX_FILENAME_LEN = 256
    Private Declare Function GetVolumeInformation& Lib "kernel32" Alias "GetVolumeInformationA" _
    (ByVal lpRootPathName As String, ByVal pVolumeNameBuffer As String, _
    ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, _
    lpMaximumComponentLength As Long, lpFileSystemFlags As Long, _
    ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long)


    '===============Volume serial number===================



    Public Function VolumeSerialNumber(DriveLetter As String) As Long
    'Returns Zero if no serial number could be found

    Dim ser As Long
    Dim s As String * MAX_FILENAME_LEN
    Dim s2 As String * MAX_FILENAME_LEN
    Dim i As Long
    Dim j As Long

    Call GetVolumeInformation(DriveLetter + ":\" & Chr$(0), s, MAX_FILENAME_LEN, ser, i, j, s2, MAX_FILENAME_LEN)
    VolumeSerialNumber = ser
    End Function

    '==============Volume name information =============

    Public Function GetVolumeName(DriveLetter As String) As String
    Dim ser As Long
    Dim s As String * MAX_FILENAME_LEN
    Dim s2 As String * MAX_FILENAME_LEN
    Dim i As Long
    Dim j As Long

    Call GetVolumeInformation(DriveLetter + ":\" & Chr$(0), s, MAX_FILENAME_LEN, ser, i, j, s2, MAX_FILENAME_LEN)
    VolumeName = Left$(s, InStr(s, Chr$(0)) - 1)
    End Function

  3. #3
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Location
    Beverwijk, Holland
    Posts
    14

    Thumbs up Thanks

    Thanks for all help
    Live Long and Prosper,

    Leo Schelvis
    [ECH]

    VB6

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