Guest User

Untitled

a guest
Jan 20th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Set objFSO = CreateObject("Scripting.FileSystemObject")
  2. objStartFolder = "C:\ScriptTesting\tFolder"
  3.  
  4. Set objFolder = objFSO.GetFolder(objStartFolder)
  5. REM Wscript.Echo objFolder.Path
  6. Set colFiles = objFolder.Files
  7. For Each objFile in colFiles
  8. Wscript.Echo objFolder.Path & "\" & objFile.Name
  9. Next
  10. ShowSubfolders objFSO.GetFolder(objStartFolder)
  11. Sub ShowSubFolders(Folder)
  12. For Each Subfolder in Folder.SubFolders
  13. Set objFolder = objFSO.GetFolder(Subfolder.Path)
  14. Set colFiles = objFolder.Files
  15. For Each objFile in colFiles
  16. Wscript.Echo SubFolder.Path & "\" & objFile.Name
  17. Wscript.Echo objFile.attributes
  18. objFile.attributes = 1
  19. Next
  20. ShowSubFolders Subfolder
  21. Next
  22. End Sub
Add Comment
Please, Sign In to add comment