I'm sorry if this has already been brought up - but how do I deal with TB sized drives? A long time ago I found some code to help convert the size to GB:
If Val > 1000000000 ; GB
NewVal = Val / 1024000000.0
NewVal = StrCat( NewVal, " GB" )
EndIf
Math really isn't a strong point. Thanks for your help!
You need to be more specify. What exactly do you want to do with your terabyte sized drives?
Apologies - dragging a bit. The script gets the total disk size, disk used and percent free - and with help and borrowed code any disk under a TB reports correctly. At a TB however I am receiving figures like .02% free on a disk that's 1.5 TB in size and 70% free. In the code piece I included I finally figured that adding 3 more zeros to "NewVal = Val / 1024000000.0" changed GB to TB and it seems to work and shows the disk size and used space pretty close to what Windows reports. Where I'm lost is getting the percent free space: 1.5 TB size and 600 Gig used - how can I turn that into percent free?
nSize = 1.5
nUsed = 600
; Normalize units by convertint TiB to GiB.
nSize *= 1024.0 ; Use nSize = nSize * 1024.0 pre WinBatch 2014B
; Caculate the percentage used space.
nPrcnt = nUsed / nSize
Tony - Thank You! I even understand it!