I colored the line that errors in red. I have NO idea what the hell is wrong. :'(
VB Code:
Option Explicit Type TypeDiskDrive InterfaceType As String Partitions As Long Size As Long Status As String End Type Public DiskDrives As TypeDiskDrive Sub Main() Debug.Print "MDiskDrives->Main();" End Sub Public Sub Win32_DiskDrive() Debug.Print "MDiskDrives->Win32_DiskDrive();" Dim CIMV2 As Object Dim Result As Object Dim Row As Object Set CIMV2 = GetObject("winmgmts:\\127.0.0.1\root\CIMV2") Set Result = CIMV2.ExecQuery("SELECT InterfaceType, Partitions, Size, Status FROM Win32_DiskDrive", "WQL", &H10 + &H20) For Each Row In Result MsgBox Row.Size DiskDrives.InterfaceType = Row.InterfaceType DiskDrives.Partitions = Row.Partitions [COLOR=Red]DiskDrives.Size = Row.Size[/COLOR] DiskDrives.Status = Row.Status Next End Sub




Reply With Quote