Hi :
My question: I have many excel files on c:\temp\A0001.xls…..A1000.xls
I want to use Excel to rename A0001.xls…..A1000.xls to B0001.xls…..B1000.xls
ie. (rename B0001.xls= A0001.xls ….. B1000.xls=A1000.xls)
Thanks !
@ECHO OFF
SETLOCAL enabledelayedexpansion
FOR /l %%i IN (1,1,1000) DO (
SET newname=000%%i
SET newname=!newname:~-4!
IF EXIST a!newname!.xls (
ECHO REN a!newname!.xls b!newname!.xls
REN a!newname!.xls b!newname!.xls
)
)
Sir :
Can you tell in detail about : " put this in a dos batch file"
means to open windword 2010 program then creat a new macro ?
I really don't underrtsnd what is your means?
Sincerly !
open a notepad, copy them into the notepad, save the notepad into a file named, say, rename.bat, under the folder you have your excel files, and then open a dos command, change to that folder, enter "rename" and hit enter to execute the command.