I am not keen on using the recursion at all. I am just looking for a way to rename my files in many directories over many backup disks. In the process of renaming I need to remove/replace some strung from the file name.
I don't need a full blown rbust solution. Just a way to reduce the manula work. The script works for a single directory and it renames the files correctly. Here is an idea a threw earlier today. I am reposting for easy reference.
====================================================
Since the basic code works for a directory I think the following idea might work. but I don't have the knowledge base to do the programming in shell.
1. Parameterize the basic code, ie. pass the directory path to this script.
2. Make another script to scan through the subdirectories recursively and when a it finds a directory call the first batch file (from point #1) with the directory as parameter.
This code seems to rename files recursively. May be the gurus can tweak it to make it work with the above routine.
For /r %%x in (*.jpg) do ren "%%x" *.jpeg
Notice the /r switch in the FOR clause for scanning the directories recursively.
===============================================================
Thanks,
myshutterclicks
Sorry that did not help.
I am just shooting in the dark. That is why I am the Geek after dark.
You need the /s to get all sub directories. -Right?
Well, just move the DIR thing out of the for loop.
I have been following this third, but get lost in the stuff. Do you really need recursion? Can you just use iteration? Maybe I missed something.
Could you just do DIR *.JPG /B/S >big-list.txt
Then have the for loop precess each line in big-list.txt
That way the for loop does not have to do recursion. I guess.