Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hard drive remaining space

Status
Not open for further replies.

Kchinnaswamy

IS-IT--Management
Jan 31, 2001
27
US
I need to find the harddrive space on a destination drive. It always returns 2 Gig. How can I get the actual disk space?

help please....

thanks

Kumar.
 
Try this code:

Private Sub ShowFreeSpace()
Dim fs, d, s
Dim drvPath as String
drvPath = "C:"
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(drvPath))
s = "Drive " & UCase(drvPath) & " - "
s = s & d.VolumeName & vbCrLf
s = s & "Free Space: " & FormatNumber(d.FreeSpace / 1024, 0)
s = s & " Kbytes"
MsgBox s
End Sub

This came from the help file.

ntp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top