Re: rename files to be numbered sequentially

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jack (jslimp01_at_earthlink.net)
Date: 09/21/04


Date: Tue, 21 Sep 2004 01:06:34 -0400

David,

I'm not sure I follow you.

Say the 1st batch file is FIRST.BAT and the 2nd is RenFile.bat

Does FIRST.BAT include:

Set X=0
for %%A IN (*.*) Do Call RenFile %%A
set /a x=x+1
ren "%1" "%~n1%x%%~x1"

Does RenFile.bat include:

ren "%1" "%x%%~n1%~x1"
%~n1 = Name
%~x1 = Extension

BTW, I sent this same post on Sep 18, but I don't see it!?

Jack

"David Candy" <david@mvps.org> wrote in message
news:e9yunscnEHA.4056@TK2MSFTNGP09.phx.gbl...
Create two batch Files

Set X=0
for %%A IN (*.*) Do Call RenFile %%A

and call the second RenFile
set /a x=x+1
ren "%1" "%~n1%x%%~x1"

This will a an incrementing number to the end of the file name for all files
in the folder it's run in.

The %x% substring is the number. To move to the front
ren "%1" "%x%%~n1%~x1"

%~n1 = Name
%~x1 = Extension (it includes the .)

--
----------------------------------------------------------
http://www.uscricket.com
"Rock" <rock@comcast.nospam.net> wrote in message
news:O$uFtncnEHA.4004@TK2MSFTNGP10.phx.gbl...
> Jack wrote:
>
> > That is good info.  However, I want to put the sequencing numbers in
front,
> > in addition, and keep the current file name, e.g.,
> > cat.jpg
> > cats.jpg
> > dog.jpg
> > dogs.jpg
> > elephant.jpg
> >
> > to
> >
> > 001cat.jpg
> > 002cats.jpg
> > 003dog.jpg
> > 004dogs.jpg
> > 005elephant.jpg
> >
> > I have a lot of pictures in different folders that I want to merge and
> > purge, and if I could number them first, it would keep things in order.
> >
> > Jack
> >
> >
> >
> >
> > "MAP" <MAP@discussions.microsoft.com> wrote in message
> > news:33F4D516-8BC9-4E58-AA2B-55E2F1849BBC@microsoft.com...
> >
> >
> > "Jack" wrote:
> >
> >
> >>Is it possible to use Windows Explore (File manager) to rename files so
> >
> > they
> >
> >>are numbered sequentially?  That is, I have a lot of files in a folder
> >
> > that
> >
> >>I would like to rename by simply adding 001, 002, 003, 004, etc. to the
> >>current file names.
> >>
> >>Jack
> >>
> >>
> >>
> >
> >
> > Files - Rename
> >
> > How to Rename Multiple Files with Windows Explorer. Start Windows
Explorer.
> > To do so, click Start, point to All
> > Programs, point to Accessories, and then click Windows Explorer. Select
> > multiple files in a folder. To do so, press and
> > hold down the CTRL key while you are clicking files. After you select
the
> > files, press F2. Type the new name, and then
> > press ENTER.
> >
> > NOTE: When you complete the preceding steps, the highlighted state of
all
> > files except one disappears, so it may appear
> > as if you are only renaming one file. However, after you press ENTER,
all of
> > the files are renamed. When you rename multiple files, all of the
renamed
> > files have the same name with a number in parentheses appended to the
name
> > to
> > make
> > the new file name unique. For example, if you type BUDGET as the new
name,
> > the first file is named BUDGET. All of
> > the remaining selected files are named BUDGET( x ), where x is a unique
> > number, starting with (1).
> >
> >
>
> Download IRfanview.  It's a great freeware image viewer and has a module
> for renaming files.  XP can't do bulk renaming the way you want.
>


Relevant Pages

  • Re: How To Make index.shtml As A Home Page?
    ... Tools - Folder Options - View tab ... Now (still in Windows Explorer) browse to your web and delete the ... If I could get rid of the thicket file, I think I could just rename ...
    (microsoft.public.frontpage.client)
  • Re: rename files to be numbered sequentially
    ... Jack wrote: ... >>Is it possible to use Windows Explore to rename files so ... > Programs, point to Accessories, and then click Windows Explorer. ... Download IRfanview. ...
    (microsoft.public.windowsxp.general)
  • Re: rename files to be numbered sequentially
    ... > Jack wrote: ... >>>Is it possible to use Windows Explore to rename files so ... I have a lot of files in a folder ... >> Programs, point to Accessories, and then click Windows Explorer. ...
    (microsoft.public.windowsxp.general)
  • Re: Cannot delete file with long name
    ... through it and found a problem when attempting to delete some odd temporary internet files. ... If I try to delete the file by selecting it in Windows Explorer and then hitting the Delete key there is no response. ... I can delete the problem files by deleting the entire folder they are contained in. ... Try to rename, and if it "takes" maybe you can then delete it.. ...
    (microsoft.public.windowsxp.general)
  • Re: rename files to be numbered sequentially
    ... > Jack wrote: ... >>>Is it possible to use Windows Explore to rename files so ... I have a lot of files in a folder ... >> Programs, point to Accessories, and then click Windows Explorer. ...
    (microsoft.public.windowsxp.general)