Hi there.I have just recently found myself in the realm of writing batch files, so bear with my in my ignorance.
I am currently attempting to write a batch file that will be placed within a specific directory, and then be executed, renaming all of the files within that directory.
I am using Photoshop Elements' batch processing to resize and rename all of my photos, and save them to the directory I specify. However, unlike Photoshop, Elements limits the user to only using two values when selecting a naming scheme. Thus, rather than run a second batch in Elements, I just want to set up a dos batch file that will add the third element to my filenames.
When Elements exports the new, resized files, it names them firstname_lastname#.jpg (i.e. John_Smith1.jpg). Now, for my website, I need both thumbnail versions and full size versions of the photos. Each photo is should be denoted by a "_lg" or "_sm" at the end of it, depending on it's size. Thus, the final filename should read John_Smith1_lg.jpg.
NOTE: I don't know if this matters or not, but some files I name with just firstname, so they would be John1_lg in the end.
Now, let me explain the process I am using to make this as efficient as possible, and perhaps we can add things to the batch file to speed things up even more.
1) I create a directory for someone's photos ( C:\John Smith ).
2) I place all of the original, unedited photos in this directory.
3) I run a batch file in Photoshop Elements that resizes, reduces resolution, and renames each file, and have it save it in a subdirectory named Edited. ( C:\John Smith\Edited )
4) Here is where I need the first dos batch file. It will rename the files to John_Smith1_lg.jpg.
5) If possible, I would like the batch file to also cut and paste the newly renamed files into the main John Smith directory.
6) Now I run the second batch in Elements, creating the thumbnail version of the photos, and again saving it into the "Edited" directory.
7) Here is where the second dos batch file is needed. It will rename the files to John_Smith1_sm.jpg. I would also like this second batch to cut and copy the files it has renamed and paste them into the main John Smith directory, and then delete the "Edited" directory completely, as it is no longer needed.
One final note, the directory structure I am using for this project is not as simple as C:\foldername. It's actually L:\Folder1\Folder2\Folder3\Folder4\Folder5, where folders 3, 4 and 5 are different each time. Folder 5 is the directory I create to store the files, listed in Step 1 above. (I.e. John Smith).
Here is the part I wrote already:
===============
@echo off
RENAME *.jpg *_lg.jpg
===============
But that didn't work, and doesnt do half the stuff I mentioned above... help this n00b out, please? :) I can provide you with any additional information you need, I just didn't know what was pertinant. Oh one thing I forgot, due to the LONG file structure I am using for this, I think my easiest course of action would be to simply copy and paste these bat files into each "Edited" directory, whenever I need it. That way I don't have to remember the entire directory address each time.