Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Loops through all sub directories and writes to all files
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- On Error Resume Next
- objStartFolder = "c:\MyDir"
- Set objFolder = objFSO.GetFolder(objStartFolder)
- Set colFiles = objFolder.Files
- For Each objFile in colFiles
- On Error Resume Next
- Set File = objFSO.CreateTextFile(objFile,True)
- File.Write "..."
- File.Close
- On Error GoTo 0
- Next
- ShowSubfolders objFSO.GetFolder(objStartFolder)
- Sub ShowSubFolders(Folder)
- For Each Subfolder in Folder.SubFolders
- On Error Resume Next
- Set objFolder = objFSO.GetFolder(Subfolder.Path)
- Set colFiles = objFolder.Files
- For Each objFile in colFiles
- On Error Resume Next
- Set File = objFSO.CreateTextFile(objFile,True)
- File.Write "..."
- File.Close
- On Error GoTo 0
- Next
- ShowSubFolders Subfolder
- On Error GoTo 0
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement