Multiple file renaming

Microsoft Excel 2003 (full product)
July 13, 2010 at 10:06:00
Specs: Windows XP
Hello, I would like to ask if I want to rename my filename from "copy of file1.xls" into "book1.xls" "copy of file2.xls" into "book2.xls" and so on. How can I write this batch program and work in the DOS mode. Thank you

See More: Multiple file renaming

Report •

July 14, 2010 at 09:43:19
These are not DOS filenames. You'd be better off in the XP forum, or the programming.

How high does the sequence of numbers go?

Helping others achieve escape felicity


Report •

July 15, 2010 at 05:48:26
Actually my sequence is up to 100 files. If I type
rename "XXXX1.xls" "Yza001.xls"
rename "XXXX2.xls" "Yza002.xls"


however, for 100 files, I need to type rename ....... for 100 statements, it is quite tedious. So I want to know is there anyone who can teach me how to type the batch program (DOS command) so that it can reduce the no. of lines in the program. Thank you.

Report •

July 18, 2010 at 14:31:15
For long lists of renames, I tend to do a basic directory listing and pipe it into a text file. I then use excel to build the needed new files, build a cell with the rename command (including all the " needed) and then copy/paste that into a .bat file to execute it.

Just a thought,

Report •

Related Solutions

July 19, 2010 at 13:41:21
Sorry for again recommending this website and the package DOSUTILS.ZIP which can be found there.

But one possible approach to get the job done could be as follows:

dir *.xls | fam /M1=XLS rename \f0.\f1 \f0.\f1 > r.lst
fam /M2(XXXX /S2Yza00 < r.lst > r.bat

This should (at least under true MS-DOS 6.22) generate the batch file r.bat with the proper rename commands. The command FAM can be found in the above mentioned zip-file and the the file DOSUTILS.TXT, in the same archive, tells you all the details.

Report •

July 28, 2010 at 07:15:42

I am trying to rename 5000 files using this method but when I copy and paste into Excel I only get the last 296 files.

Am I doing something wrong?

Any advice would be much appreciated as the alternative may drive me insane!

Thanks in advance

Report •

Ask Question