CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: VB6 Disk Space

  1. #1
    Join Date
    Mar 2000
    Location
    Ft. Lauderdale, FL
    Posts
    36

    VB6 Disk Space

    How do I find out how much of free disk space I got via a VB6 program?


  2. #2
    Join Date
    Jul 2000
    Posts
    29

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: VB6 Disk Space

    Dim FilSysObj As Scripting.FileSystemObject
    Dim DriveCollection As Drives
    Dim objDrive As Drive

    Private Sub Main()

    Set FilSysObj = New Scripting.FileSystemObject
    Set DriveCollection = FilSysObj.Drives

    For Each objDrive In DriveCollection
    If objDrive.DriveType = 3 Then 'Network Drive
    MsgBox objDrive.ShareName
    If objDrive.IsReady Then
    MsgBox objDrive.AvailableSpace
    MsgBox objDrive.TotalSize
    'Subtract AvalableSpace from Total Size
    'You can also use objDrive.FreeSpace
    End If
    End If
    Next

    End Sub


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured