rename over a tree

#1
I would like to rename all all.bat files in a directory tree to all.btm. There is not necessarily an all.bat in each branch of the tree.

I tried:

global rename /E all.bat all.btm

Without success. rename /S is for renaming dirs, not files.

Why doesn't that work? How do you do it?
 
#4
Roedy wrote:

| ---Quote (Originally by Roedy)---
| global rename /E all.bat all.btm
| ---End Quote---
| I figured out the secret. I needed:
| global */I *rename /E all.bat all.btm

I presume you meant
*global /I *rename /E all.bat all.btm

In other words, GLOBAL and/or RENAME on your system are aliases, and you
needed the original commands! I think you learned a valuable lesson or two
(which I need to remember time to time myself) - when something does not
operate as expected, check for aliases. Do not create an alias name that is
the same as an internal command name. I very rarely do; DEL, MD and REN are
the exceptions - I can always use ERASE, MKDIR and RENAME to get the
original commands through their alternate names. For example, I use SWEEP as
the basis of aliases based on the GLOBAL command.
BTW, this thread really belongs to the TC Support forum. You ran into a
problem trying to do something reasonably expected to be possible - that's
just right in Support. Almost everyone who watches any of the TC fora
watches Support, while only a few watch any of the TIPS.
--
Steve
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,575
46
Albuquerque, NM
prospero.unm.edu
#5
Roedy wrote:

| ---Quote (Originally by Roedy)---
| global rename /E all.bat all.btm
| ---End Quote---
| I figured out the secret. I needed:
| global */I *rename /E all.bat all.btm

I presume you meant
*global /I *rename /E all.bat all.btm
Not certain, but I suspect that the asterisks you're seeing are not Roedy's; I think they are the result of the forum smashing his boldface to fit your text-only email ...?
 
#6
Charles Dye wrote:
...
| global */I *rename /E all.bat all.btm
...
| *global /I *rename /E all.bat all.btm

| Not certain, but I suspect that the asterisks you're seeing are not
| Roedy's; I think they are the result of the forum smashing his
| boldface to fit your text-only email ...?

You are correct that the OP had no asterisks. This makes my post OT. As
to the forum doing the smashing, it is possible, and WRONG! It should never
insert characters which have a syntactic meaning in TCC, just disguising the
issue posted. Anyway, I just switched my profile to allow HTML from the
forum. It was already allowed in my mail client (OE). Now I have to wait for
other messages to see if things improve. Thanks, Charles.
--
Steve