VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get all the root name spaces of your machine 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 the root name spaces of your machine using WMI script

Rate Get all the root name spaces of your machine using WMI script



Computer = "."
Const ForAppending = 2
Set OutFile = CreateObject("WScript.Shell")
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\NameSpaces.txt", ForAppending, True)
TextFile.WriteLine "Name Spaces of this Machine"
TextFile.WriteLine "---------------------------"
TextFile.WriteLine

Call NameSpaces("root")
TextFile.Close
OutFile.Run "notepad.exe c:\NameSpaces.txt",1,True


Sub NameSpaces(NameSpace)

  TextFile.WriteLine NameSpace
  Set WMIService = GetObject("winmgmts:\\" & Computer & "\" & NameSpace)
  Set OupNameSpaces = WMIService.InstancesOf("__NAMESPACE")
  For Each ItemNameSpace In OupNameSpaces
  Call NameSpaces(NameSpace & "\" & ItemNameSpace.Name)
  Next

End Sub

 

Download this snippet    Add to My Saved Code

Get all the root name spaces of your machine using WMI script Comments

No comments have been posted about Get all the root name spaces of your machine using WMI script. Why not be the first to post a comment about Get all the root name spaces of your machine using WMI script.

Post your comment

Subject:
Message:
0/1000 characters