I have a directory with a bunch of subdirectories.
MAIN_DIR\
Each sub-dir is a “project name”, e.g.
MAIN_DIR\BOBEVANS324
MAIN_DIR\BILLJOHNSON3
Each “project” folder contains a bunch of sub-dirs in it. Let’s say I was looking for “.abc” files that all have names that make no sense without looking at the folder structure. For example,
MAIN_DIR\BOBEVANS234\SUBDIR\3904902490.abc
As you can see “3904902490.abc” doesn’t make any sense outside the context of the directory tree. I’d want to rename it by appending the directory names to the filename after copying the file.
So, it would look through ALL subfolders of MAIN_DIR and try to find “.abc” files. When it finds one, it copies it over to a dest directory and renames it something like “BOBEVANS234_SUBDIR_3904902490.abc”.
You want to look at the FileSystemObject, especially the Folder Object and it’s SubFolders and Name (to create the new names) properties and the File Object and it’s Move Method (remember, if you move a file to a different name in the same directory, it will have the same effect as a rename).
To find the files to rename, you’ll have to look for them by hand unfortunately, though it is reasonably easy as can be seen in this MS KB article (it’s written for VB6 but that’s very similar to VBScript): HOW TO: Recursively Search Directories by Using FileSystemObject