Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- objStartFolder = "C:\ScriptTesting\tFolder"
- Set objFolder = objFSO.GetFolder(objStartFolder)
- REM Wscript.Echo objFolder.Path
- Set colFiles = objFolder.Files
- For Each objFile in colFiles
- Wscript.Echo objFolder.Path & "\" & objFile.Name
- Next
- ShowSubfolders objFSO.GetFolder(objStartFolder)
- Sub ShowSubFolders(Folder)
- For Each Subfolder in Folder.SubFolders
- Set objFolder = objFSO.GetFolder(Subfolder.Path)
- Set colFiles = objFolder.Files
- For Each objFile in colFiles
- Wscript.Echo SubFolder.Path & "\" & objFile.Name
- Wscript.Echo objFile.attributes
- objFile.attributes = 1
- Next
- ShowSubFolders Subfolder
- Next
- End Sub
Add Comment
Please, Sign In to add comment