Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

rename over a tree

Jun
127
2
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?
 
My first thought is to add the /I switch to the GLOBAL command:

X:\> global /i rename /e all.bat all.btm

That switch's purpose is documented in the main help for GLOBAL.


HTH,
Dan McMullin
 
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
 
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 ...?
 
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
 
Or .....

for /r if isfile all.bat rename all.bat all.btm

??
 
Back
Top
[FOX] Ultimate Translator
Translate