Renaming files in one swoop

apawlik

Distinguished
Apr 21, 2005
3
0
18,510
Archived from groups: microsoft.public.win2000.general (More info?)

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
 

Royce

Distinguished
Jul 3, 2004
64
0
18,630
Archived from groups: microsoft.public.win2000.general (More info?)

you will find the answer to your question in this group -
http://www.microsoft.com/technet/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.win2000.cmdprompt.admin&lang=en&cr=US



"APawlik" wrote:

> 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
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

"APawlik" <pawlix@gmx.net> wrote in message
news:uROjC$6YFHA.3032@TK2MSFTNGP10.phx.gbl...
> 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.
 

apawlik

Distinguished
Apr 21, 2005
3
0
18,510
Archived from groups: microsoft.public.win2000.general (More info?)

Pegasus (MVP) wrote:
>>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.


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
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

APawlik wrote:
> Pegasus (MVP) wrote:
>
>>>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.
>
>
>
> 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"
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

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

"Rob Stow" <rob.stow@shaw.ca> wrote in message
news:e$PnP2vZFHA.1412@TK2MSFTNGP12.phx.gbl...
> APawlik wrote:
> > Pegasus (MVP) wrote:
> >
> >>>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.
> >
> >
> >
> > 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"
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.general (More info?)

On Wed, 01 Jun 2005 17:05:48 -0600, Rob Stow <rob.stow@shaw.ca> wrote:
> for /f "delims=" %i in (list.txt) do rename "%i" "1999_%i"

Couldn't he simply do it directly?

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

--
RoRo
 

apawlik

Distinguished
Apr 21, 2005
3
0
18,510
Archived from groups: microsoft.public.win2000.general (More info?)

Robert Roland wrote:
> On Wed, 01 Jun 2005 17:05:48 -0600, Rob Stow <rob.stow@shaw.ca> wrote:
>
>> for /f "delims=" %i in (list.txt) do rename "%i" "1999_%i"
>
>
> 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