Computing.Net > Forums > Windows XP > rename batch file

rename batch file

Reply to Message Icon

Original Message
Name: ging
Date: July 31, 2008 at 12:35:14 Pacific
Subject: rename batch file
OS: xp
CPU/Ram: 1000
Comment:

I have tons of excel files to rename. All excel files doesn't have a regular naming conversion. for example there are asbd.xls fdsfdh.xls

I need to change all 3000 files to something in order like 1.xls, 2.xls and up to 3000.xls

Is there a batch files that can do that?

Thx in adavnace.



Report Offensive Message For Removal

Response Number 1
Name: jefro
Date: July 31, 2008 at 15:55:56 Pacific
Subject: rename batch file
Reply: (edit)

There are tons of ways. I do simple ways like put all the file names into a text file then use that test file to serve as input to the next rename command.

"Best Practices", Event viewer, host file, perfmon, are in my top 10


Report Offensive Follow Up For Removal

Response Number 2
Name: Mechanix2Go
Date: July 31, 2008 at 18:22:19 Pacific
Subject: rename batch file
Reply: (edit)

@echo off
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in ('dir/b/a-d *.XLS') do (
set /a N+=1
ren %%a !N!.XLS
)


=====================================
If at first you don't succeed, you're about average.

M2


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: rename batch file

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software