Guest User

Untitled

a guest
Dec 11th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Dim xdoc
  2. Function CreateFolders(objFile)
  3. Dim elem
  4. Dim attr
  5. set elem = xdoc.createElement("Folders")
  6. set attr = xdoc.createAttribute("Description")
  7. attr.value = objFile.Description
  8. elem.setAttributeNode attr
  9. set CreateFolders = elem
  10. End Function
  11.  
  12. Dim FilePath
  13.  
  14. Dim objFile
  15. Dim root
  16. Dim elem, elem1
  17.  
  18.  
  19. Set xdoc = CreateObject("MSXML2.DOMDocument.6.0")
  20. xdoc.appendChild xdoc.createProcessingInstruction ("xml", "version=""1.0"" encoding=""utf-8""")
  21. FilePath = "C:UsersUserDownloadsM.xml"
  22.  
  23. set root = xdoc.createElement("Folders")
  24. xdoc.appendChild root
  25.  
  26.  
  27. strComputer = "."
  28. Set objWMIService = GetObject("winmgmts:" _
  29. & "{impersonationLevel=impersonate}!\" & strComputer & "rootcimv2")
  30. Set colFiles = objWMIService.ExecQuery _
  31. ("Select * from Win32_Directory Hidden = True")
  32. For Each objFile in colFiles
  33. Wscript.Echo objFile.Name
  34. Next
Add Comment
Please, Sign In to add comment