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!

Finding drive size 1

Status
Not open for further replies.

beedubau

Programmer
Jan 7, 2003
97
AU
I am using

Code:
oFSO = CREATEOBJ('Scripting.FileSystemObject')
oDrive = oFSO.GetDrive(CHR(I)+":")
oSize = TRANSFORM(oDrive.TotalSize)

to find drive sizes ( with some further processing to get say 35.6 GB.

The value of oSize for my 250GB drive is

**********.*********

Is there any way to get this value which is shown in Windows explorer as 232 GB usable?

Regards

Bryan


 
Bryan,

Instead of this:

oSize = TRANSFORM(oDrive.TotalSize)

do this:

oSize = TRANSFORM(oDrive.TotalSize, "999,999,999,999")

Alternatively, divide oDrive.TotalSize by 1,048,576 to get it to megabytes.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Mike,

Thanks again.

I used oSize = TRANSFORM(oDrive.TotalSize, "999999999999") so I could do my maths later

I now get 250048479232 which is correct.


Regards

Bryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top