Hopefully "ScriptingTipsAndTricks" helps you with your batch file or vbscript scripting :-)
[Bottom][Contents][Prev]: Microsoft WMI Object Queries[Next]: ListClasses.vbs
\->Introduction->WMI (Windows Management Instrumentation)->Microsoft WMI Object Queries->ListNameSpaces.vbs

ListNameSpaces.vbs

This shows how to list all WMI namespaces (from the root):

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root")
Set objNameSpaces = objWMIService.InstancesOf("__NAMESPACE")

For Each objNameSpace In objNameSpaces
   WScript.Echo objNameSpace.Name
Next

Sample Output (sorted by me)

aspnet
CIMV2
Cli
DEFAULT
directory
Interop
Microsoft
nap
RSOP
SECURITY
SecurityCenter
SecurityCenter2
ServiceModel
subscription
WMI


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Microsoft WMI Object Queries[Next]: ListClasses.vbs


ScriptingTipsAndTricks© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday September 07 2014 at 12:50pm
Visit ScriptingTipsAndTricks's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.