VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get all WMI classes of your computer using WMI script

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

Rate 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


Download this snippet    Add to My Saved Code

Get all WMI classes of your computer using WMI script Comments

No comments have been posted about Get all WMI classes of your computer using WMI script. Why not be the first to post a comment about Get all WMI classes of your computer using WMI script.

Post your comment

Subject:
Message:
0/1000 characters