I'm trying to get used disk space on a server however, usedspace isn't the right syntax for the com object. Could someone tell me where to look or tell me what the syntax is please?
Thanks
Thanks
Code:
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colHardDrives = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk where Drivetype = " _
& HARD_DISK & "")
For Each objHardDrive In colHardDrives
UsedSpace = (objHarddrive.UsedSpace / objHardDrive.Size * 100)
oLogFile.Writeline "DeviceID: " & objHardDrive.DeviceID
oLogFile.Writeline "UsedSpace: " & objHardDrive.UsedSpace/1024\1024+1 & " MB"
Next