Renaming files in one swoop

A

APawlik

Is there a way in Win2000 to rename a bunch of
files in one swoop ? The ren command doesn't seem
to work the same way it did under DOS. When I do

ren *.ext 1999_*.ext

the first five letters of all file names are replaced
by 1999_.

Hints much appreciated.
________
Andreas
 
P

Pegasus \(MVP\)

APawlik said:
Is there a way in Win2000 to rename a bunch of
files in one swoop ? The ren command doesn't seem
to work the same way it did under DOS. When I do

ren *.ext 1999_*.ext

the first five letters of all file names are replaced
by 1999_.

Hints much appreciated.
________
Andreas

What you actually wish to do? Please give an example.
 
A

APawlik

Pegasus said:
What you actually wish to do? Please give an example.


Sorry, didn't see your answer until today. Hope
you'll see mine now.

I need to rename lots of files by adding something at the beginning,
changing the filenames from, say
abc.ext
bcd.ext
cde.ext
to
1999_abc.ext
1999_bdc.ext
1999_cde.ext

Thank you for your interest.
________
Andreas
 
R

Rob Stow

APawlik said:
Sorry, didn't see your answer until today. Hope
you'll see mine now.

I need to rename lots of files by adding something at the beginning,
changing the filenames from, say
abc.ext
bcd.ext
cde.ext
to
1999_abc.ext
1999_bdc.ext
1999_cde.ext

Thank you for your interest.
________
Andreas


Get all of the original filenames into a text file with something
like this:
dir /b ???.ext >list.txt

Then run this:
for /f "delims=" %i in (list.txt) do rename "%i" "1999_%i"
 
J

j9

Sadly, this is the kind of thing that I keep Unix4Dos or Perl4Dos on the
computer for....
 
A

APawlik

Robert said:
Couldn't he simply do it directly?

for %i in (*.*) do rename "%i" "1999_%i"


You're the men, Robert and Rob! Thank you very much.
Where does one find that stuff ? Wrote a lot of batch files in DOS
but this is new to me.
________
Andreas
 

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