JOK
asked on
FSO gives wrote TotalSize
I'm trying to write a little app to give FreeSpace/TotalSize for my HDs
The HDs are around 2.5, 3.5 and 3, but Total size always gives around 1.99
What am I missing? The drives are Fat32 and I'm using VB6 sp3 and scrrun.dll is 5.1.0.4615
PC is using Win98
The HDs are around 2.5, 3.5 and 3, but Total size always gives around 1.99
What am I missing? The drives are Fat32 and I'm using VB6 sp3 and scrrun.dll is 5.1.0.4615
PC is using Win98
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I hate fast answers. Makes me feel dumber than I am.
It worked.
I couldn't find anything on msdn. Guess I didn't know what to search for.
It worked.
I couldn't find anything on msdn. Guess I didn't know what to search for.
ASKER
You've got the points already, but what about for available space. Would using FSO work or is there the same limit?
Thank you very much, JOK, for the points! I am glad that I could be of any help to you! Again, thanks!
Just logged on a few minutes ago. ;-)
Just logged on a few minutes ago. ;-)
Yes.....
Increase more points!! ;-)
Private Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias "GetDiskFreeSpaceExA" (ByVal lpRootPathName As String, lpFreeBytesAvailableToCall er As Currency, lpTotalNumberOfBytes As Currency, lpTotalNumberOfFreeBytes As Currency) As Long
Private Function GetFreeSpace(pDrive As String) As String
Dim curTotalBytes As Currency
Dim curFreeBytesToCaller As Currency
Dim curTotalFreeBytes As Currency
Call GetDiskFreeSpaceEx(pDrive, curFreeBytesToCaller, curTotalBytes, curTotalFreeBytes)
GetFreeSpace = Format$(curTotalFreeBytes * 10000, "###,###,###,##0")
End Function
Private Sub Command1_Click()
MsgBox "Free space on drive C: is: " & GetFreeSpace("C:")
End Sub
Increase more points!! ;-)
Private Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias "GetDiskFreeSpaceExA" (ByVal lpRootPathName As String, lpFreeBytesAvailableToCall
Private Function GetFreeSpace(pDrive As String) As String
Dim curTotalBytes As Currency
Dim curFreeBytesToCaller As Currency
Dim curTotalFreeBytes As Currency
Call GetDiskFreeSpaceEx(pDrive,
GetFreeSpace = Format$(curTotalFreeBytes * 10000, "###,###,###,##0")
End Function
Private Sub Command1_Click()
MsgBox "Free space on drive C: is: " & GetFreeSpace("C:")
End Sub
JOK,
Just kidding about increasing more point! Anyway, did you get working for available space on your hard drive? Please let me know. Thank you very much.
Just kidding about increasing more point! Anyway, did you get working for available space on your hard drive? Please let me know. Thank you very much.
ASKER
Looks like its working for both.
I've used FSO with ASP and it seems to work properly.
I can give you more points if you can tell me if, in fact it does work with ASP, or why it doesn't.
I've used FSO with ASP and it seems to work properly.
I can give you more points if you can tell me if, in fact it does work with ASP, or why it doesn't.
JOK: I don't know anything about ASP. I really can't help you with this ASP question. Sorry.
ASP - Active Server Page? I am not a web developer.
ASKER
With ASP, you can us VBScript which is a "subset" of VB. FSO is FileSystemObject, and you can use it with VB or VBScript.
Oh well. I really appreciate your help, 'tho.
Oh well. I really appreciate your help, 'tho.
ASKER
maybe I should check my code for a typo ;)