I have the following code inserted into a script I am working on and need
some help with two items.
1. How can I get the totalsize formated into MB
2. The strFile.WriteLine at the bottom keeps giving me an error. IT doesn't
seem to like the double )). How do I fix this.
Please bear in mind that noob status would mean I know more than I currently
do. Be gentle.
The code below is a snippet from my script.
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk Where DriveType = 3")
For Each objDisk in colDisks
intFreeSpace = objDisk.FreeSpace
intTotalSpace = objDisk.Size
strFile.WriteLine(intTotalSpace)
pctFreeSpace = intFreeSpace / intTotalSpace
strFile.WriteLine(objDisk.DeviceID, FormatPercent(pctFreeSpace))
Next
Thanks,
Aaron