Link to home
Start Free TrialLog in
Avatar of martyuni
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-0002EA39C4E4" "GameClip1"

I need to look for that GUID in all folder levels and change the name.  Hope that makes sense.
Avatar of Stuart_Page
Stuart_Page

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?
Avatar of Bill Prew
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
Avatar of martyuni

ASKER

I wrote a query and created records like this

ren "6C8F91E5-B5EB-4EA5-9952-0002EA39C4E4" "GameClip1"

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
would like to do both
ASKER CERTIFIED SOLUTION
Avatar of ReneGe
ReneGe
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Don't worry Bill. We'r just having fun helping others, hoping we'll learn something in the process :)

Cheers,
Rene
Thank you both for your help
Your welcome!
Welcome, good luck.

~bp