by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Tue 11th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Get all WMI classes of your computer using WMI script
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\WMIClasses.txt", ForAppending, True)
TextFile.WriteLine "WMI Classes of root\cimv2"
TextFile.WriteLine "---------------------------"
TextFile.WriteLine
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set OupClasses = WMIService.SubclassesOf()
For Each WMIClass In OupClasses
TextFile.WriteLine WMIClass.Path_.Class
Next
TextFile.Close
OutFile.Run "notepad.exe c:\WMIClasses.txt",1,True