Created
January 11, 2012 16:40
-
-
Save 4ndrew/1595537 to your computer and use it in GitHub Desktop.
Bulk files rename on Windows without tools (for stackoverflow)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Path = "C:\Users\put-your-folder-name-here" | |
Set FSO = CreateObject("Scripting.FileSystemObject") | |
Sub visitFolder(folderVar) | |
For Each fileToRename In folderVar.Files | |
fileToRename.Name = "Agreement " & fileToRename.Name | |
Next | |
For Each folderToVisit In folderVar.SubFolders | |
visitFolder(folderToVisit) | |
Next | |
End Sub | |
If FSO.FolderExists(Path) Then | |
visitFolder(FSO.getFolder(Path)) | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment