Way to 'bulk change' one word in name of several folders in parent

G

Guest

Is there any tool or software for XPpro that would make it possible to 'bulk
change' one word (or phrase) in name of several folders in a parent folder?
 
P

Pegasus \(MVP\)

akm said:
Is there any tool or software for XPpro that would make it possible to 'bulk
change' one word (or phrase) in name of several folders in a parent folder?

You could try this:

- Put the following lines into c:\Windows\FolderRename.bat:
@echo off
for /F "tokens=*" %%* in ('dir /ad /b') do call :Sub %%*
goto :eof
:Sub
set name=%*
echo ren "%* "%name:ABC=XYZ%"
- Click Start / Run
- Type cmd {OK}
- Navigate to the parent folder whose subfolders you wish to rename.
- Type FolderRename {Enter}

In its current form the batch file will rename folders that contain
the string "ABC" to a name that contains the string "XYZ" instead.
It won't actually do the rename until you remove the word "echo"
in the last line of the batch file.
 
G

Guest

Pegasus
Thanks much for the reply.
My batch file skills are a little rusty.
It looks like I need to replace the 'ABC' and 'XYZ' with the actual names of
the files/folders and remove the 'echo' before running the batch file... ie
it wont prompt for the info?
Thanks again.
akm
 
P

Pegasus \(MVP\)

What you say is correct.

I recommend that you replace ABC and XYZ in a first step,
then run the batch file to ensure that what you see is what
you actually want. When satisfied, remove the "echo" word
from the last line.

Make sure that the replacement string does not contain the
original string. If, for example, you replace "Accounts" with
"Account 2003" then you will get unpredictable results. In
such cases a slightly different batch file would be required.
 
C

cquirke (MVP Windows shell/user)

On Sat, 15 Oct 2005 17:19:01 -0700, akm
Is there any tool or software for XPpro that would make it possible to 'bulk
change' one word (or phrase) in name of several folders in a parent folder?

You can only get so far with wildcards, and things can go wrong while
guessing from the command line.

So I prefer to work under direct vision, with a preview of what will
happen, using a free 3rd-party tool called CK Rename:

http://www.musicsucks.com/CKSoft/CKRename/

It works from Bart PE too :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top