Soldato
- Joined
- 25 Sep 2011
- Posts
- 3,859
Hey Guys,
Been years since i've done any vb stuff and google isnt helping much.
I have the following:
This outputs the value of 35% of the free disk space on C.
However it outputs it as "36846225203.2". I need this output as just the first 5 digits (36846) and I cannot figure out how.
Any help would be much appreciated.
Been years since i've done any vb stuff and google isnt helping much.
I have the following:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk Where DeviceID = 'C:'")
For Each objDisk in colDisks
intFreeSpace = objDisk.FreeSpace
intTotalSpace = objDisk.Size
pctFreeSpace = intTotalSpace / 100 * 35
Wscript.Echo pctFreeSpace
Next
This outputs the value of 35% of the free disk space on C.
However it outputs it as "36846225203.2". I need this output as just the first 5 digits (36846) and I cannot figure out how.
Any help would be much appreciated.