WMI Availability is always nothing/null?

StewartBW 1,235 Reputation points
2025-03-11T19:10:29.69+00:00

Hello

I'm using this code to get the Availability of system disks, but Availability is always nothing/null:

Searcher As New ManagementObjectSearcher(New SelectQuery("Win32_DiskDrive"))
    For Each MyDisk As ManagementObject In MySearcher.Get()
        MyDisk("Availability").ToString

https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-diskdrive

Any idea if that property is even working?

Thanks.

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,799 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 33,781 Reputation points Microsoft External Staff
    2025-03-12T07:47:15.1633333+00:00

    Hi @Anonymous ,

    Ensure that your application has sufficient privileges to query WMI.

    Use tools like WMI Explorer or PowerShell to test if the Availability property is populated for your system disks.

    If Availability is not populated, you might want to use other properties of the Win32_DiskDrive class like Status which indicates the current status of the disk (e.g., "OK").

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.