Re: Schema Query - Top Level Classes Only



Thanks Jeffrey, urkec,

This answers my question.

The reason I wanted to do it by method calls, is so that I could use recursion to enum the classes and sub-classes (starting from any point in the tree). The WQL query is less suited to this.

Jeffrey Tan[MSFT] wrote:
Hi Gerry,

Thanks for your feedback. Oh, it seems that urkec has provided the correct answer to you. Thank you urkec!

Actually, it's not clear to me why you prefer to not use the meta_class query, but you can accomplish the same thing by specifying the Shallow flag:

const wbemQueryFlagShallow = 1

set osvc = getobject("winmgmts:root\cimv2")

for each ocls in osvc.subclassesof("", wbemQueryFlagShallow)
wscript.echo ocls.path_.class
next

Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=========================================
Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg@xxxxxxxxxxxxxx

This posting is provided "AS IS" with no warranties, and confers no rights.



--
Gerry Hickman (London UK)
.



Relevant Pages

  • Re: Schema Query - Top Level Classes Only
    ... Thanks for your feedback. ... it seems that urkec has provided the correct ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ...
    (microsoft.public.win32.programmer.wmi)
  • Re: SysLink Control Problem
    ... I reproduce this issue on my machine, and I can see in the Process Explorer that the two versions of the ComCtl32 loaded by Word. ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ... reproduce the problem in an Outlook COM addin based on KB 230689. ...
    (microsoft.public.win32.programmer.ui)
  • Re: SysLink Control Problem
    ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ... reproduce the problem in an Outlook COM addin based on KB 230689. ... it is the Exchange client extension ...
    (microsoft.public.win32.programmer.ui)
  • Re: Interop.MSProject FileSaveAs
    ... The error this time is caused by the possibility that the MSProject instance ... is working offline. ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Interop.MSProject FileSaveAs
    ... The error this time is caused by the possibility that the MSProject instance ... is working offline. ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ...
    (microsoft.public.dotnet.languages.vb)

Loading