martyuni
asked on
Renames in Subdirectories
We have a vended app that we are moving away from. The system stores links to videos. The vendor changed the file names to guids so they don't make sense if you look at them through windows explorer. I found the translation table in the database. Here is an example:
MediaElementID displayName
abcd123456789xxx vs TeamA
Got a solution from someone on a query I wrote to build a batch file for the rename. My question is using a batch file how can I rename name files in a subdirectory?
For ex the file structure is like this:
FOLDER1
| FOLDER name with GUID
| FILE name with GUID
FOLDER2
So in my batch file I have:
ren "6C8F91E5-B5EB-4EA5-9952-0 002EA39C4E 4" "GameClip1"
I need to look for that GUID in all folder levels and change the name. Hope that makes sense.
MediaElementID displayName
abcd123456789xxx vs TeamA
Got a solution from someone on a query I wrote to build a batch file for the rename. My question is using a batch file how can I rename name files in a subdirectory?
For ex the file structure is like this:
FOLDER1
| FOLDER name with GUID
| FILE name with GUID
FOLDER2
So in my batch file I have:
ren "6C8F91E5-B5EB-4EA5-9952-0
I need to look for that GUID in all folder levels and change the name. Hope that makes sense.
So, to be clear, the real names for the folders is contained within a database? If so, your script would have to query the database to find the human-readable name, correct?
Will all or most of the files in the folder structure you will scan need to renamed, or just a few? (might impact the approach I suggest)
~bp
~bp
ASKER
I wrote a query and created records like this
ren "6C8F91E5-B5EB-4EA5-9952-0 002EA39C4E 4" "GameClip1"
Was going to put that in a batch file.
Billprew: There will be a lot of files to be renamed, over 6000.
ren "6C8F91E5-B5EB-4EA5-9952-0
Was going to put that in a batch file.
Billprew: There will be a lot of files to be renamed, over 6000.
And are you only renaming files, or folders as well (it looked like both have been changed to a GUID in your original post).
~bp
~bp
ASKER
would like to do both
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Don't worry Bill. We'r just having fun helping others, hoping we'll learn something in the process :)
Cheers,
Rene
Cheers,
Rene
ASKER
Thank you both for your help
Your welcome!
Welcome, good luck.
~bp
~bp