I am trying to nail down free space on a remote server by querying all the drives and then looping until I find the drive I am seeking.
Is there a better way to do this?
Why not just make your WMI query only pull back where name='Y'?
So:
Dim oQuery As System.Management.ObjectQuery = New System.Management.ObjectQuery("select FreeSpace,Size,Name from Win32_LogicalDisk where DriveType=3 AND name='Y'")