renaming folders

G

gerryR

OK this one should be simple (I think!)

We have a folder structure like this

00000_Project Name
|
00000_Letters
00000_Faxs
00000_Images
|
00000_Jpg
00000_png


etc for maybe 60+ folders and subfolders. The numbers at the start are the
job number. I'm looking for a simple way to change the project number part
for the top and all sub folders (the rest stays the same)

what I tried (and thought would work was)

rename /s c:\00000* c:\05034*

anyone any ideas ?
thanks
gerry
 
R

Reinhardt Kern

gerryR said:
OK this one should be simple (I think!)

We have a folder structure like this
[...]

Hello Gerry,

I am disappointed about your request.
In your description I assume, that you are an professional and
earn money with your task. I read from your posting, that you are
not interested in learning about batch scripting, but you want a
solution for your task for free. - So you expect me (and all
others here) to give money to you without any refund.

If you had done some research for batch scripting yourself, the
solution should be clear to you and there should be some explicit
questions about syntax or thinking about the algorithm. All this
is missing in your posting.

Sorry, this is not the way usenet is working. (My humble opinion)

So I will not provide code to you, but the simple:
"for /?" and "set /?" will show you the way.

You must walk the directory tree with for command and then do
some text replacement (set /?)


Reinhardt
 
G

gerryR

Reinhardt

I only ever post here looking for a point in the right direction (this is
the right place to do that isn't it ?) and not "do this for me", I'm sorry
if my post read that way.

Thanks for your tips, I will look into the commands and hopefully find my
answer.
cheers
gerryR

Reinhardt Kern said:
gerryR said:
OK this one should be simple (I think!)

We have a folder structure like this
[...]

Hello Gerry,

I am disappointed about your request.
In your description I assume, that you are an professional and
earn money with your task. I read from your posting, that you are
not interested in learning about batch scripting, but you want a
solution for your task for free. - So you expect me (and all
others here) to give money to you without any refund.

If you had done some research for batch scripting yourself, the
solution should be clear to you and there should be some explicit
questions about syntax or thinking about the algorithm. All this
is missing in your posting.

Sorry, this is not the way usenet is working. (My humble opinion)

So I will not provide code to you, but the simple:
"for /?" and "set /?" will show you the way.

You must walk the directory tree with for command and then do
some text replacement (set /?)


Reinhardt
 
T

Todd Vargo

gerryR said:
OK this one should be simple (I think!)

We have a folder structure like this

00000_Project Name
|
00000_Letters
00000_Faxs
00000_Images
|
00000_Jpg
00000_png


etc for maybe 60+ folders and subfolders. The numbers at the start are
the job number. I'm looking for a simple way to change the project number
part for the top and all sub folders (the rest stays the same)

what I tried (and thought would work was)

rename /s c:\00000* c:\05034*

anyone any ideas ?

gerry, IMO, the 00000_ on each folder is redundant. I would have one top
level xxxxx folder and store all related files and folders to that account
in that folder without 00000_ prefixed to every folder. Mind you, that is
just the way I would store the related folders.

I assume you don't change account numbers on a regular basis, so I consider
this is a one time chore. If Win2k/XP, you could try the following command
at the prompt. Remove the ECHO if the output looks like what you want.

FOR /D /R c:\ %f IN (00000_*) DO ECHO REN "%f" 05034*
 
J

Jerold Schulman

OK this one should be simple (I think!)

We have a folder structure like this

00000_Project Name
|
00000_Letters
00000_Faxs
00000_Images
|
00000_Jpg
00000_png


etc for maybe 60+ folders and subfolders. The numbers at the start are the
job number. I'm looking for a simple way to change the project number part
for the top and all sub folders (the rest stays the same)

what I tried (and thought would work was)

rename /s c:\00000* c:\05034*

anyone any ideas ?
thanks
gerry
See tip 1201 » Rename with wildcards.
in the 'Tips & Tricks' at http://www.jsifaq.com



Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
G

gerryR

thanks for that Todd, will give it a go.

as regards removing the 00000 from the sub directories, we have hundreds of
job folders all with their unique job number, each folder and file beneath
that job folder also has to have the job no at the start of it. If it did
not we would have thousands of file and folder names the same, this would
lead to confusion when searching and in the event that someone accidentially
copies/ drags one folder into another it would result in files getting over
written! (and this happens more that you'd beleive!!)

thanks again for the help
gerryR
 

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