Best way to query disk space on remote server

后端 未结 1 1280
-上瘾入骨i
-上瘾入骨i 2021-01-19 01:48

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?

相关标签:
1条回答
  • 2021-01-19 02:22

    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'")
    
    0 讨论(0)
提交回复
热议问题