get the description from an WMI class using vbscript

后端 未结 1 799
时光说笑
时光说笑 2021-01-15 19:28

How can I get the description from an WMI class using vbscript?

I found this example but it\'s in C#:

// Gets the class description.
try
{
    // Get         


        
相关标签:
1条回答
  • 2021-01-15 19:59

    Here's the VBScript equivalent of your C# code (only without error handling):

    Const wbemFlagUseAmendedQualifiers = &H20000
    
    strComputer = "."
    Set oWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set oClass = oWMI.Get("Win32_LogicalDisk", wbemFlagUseAmendedQualifiers)
    
    strDesc = oClass.Qualifiers_("Description").Value
    WScript.Echo strDesc
    
    0 讨论(0)
提交回复
热议问题