Computing.Net > Forums > Programming > Batch file rename and move

Batch file rename and move

Reply to Message Icon

Original Message
Name: jquestion
Date: June 5, 2006 at 09:33:14 Pacific
Subject: Batch file rename and move
OS: xp
CPU/Ram: 512
Model/Manufacturer: ibm
Comment:

I would like to create a batch file to rename all *.cap files to *.mp3 in a certain directory before moving them all to another directory. I will need to do this for multiple directories, but have them all move files to one central directory, that will have no structure, just the resulting .mp3 files.

For example:

If the file 123.cap was in the c:\test1 directory and the file 456.cap was in c:\test2 directory, I would like both of these files renamed 123.mp3 and 456.mp3 and then moved to c:\test3 (I realize this may have to be done in seperate processes) that will be the central repository for all mp3 files and have no subdirectories.

Thanks for looking at this for me.


Report Offensive Message For Removal


Response Number 1
Name: Mechanix2Go
Date: June 5, 2006 at 11:07:20 Pacific
Reply: (edit)

for %%N in (1 2) do (
ren c:\test%%N\*.cap *.mp3
move c:\test%%N\*.mp3 c:\test3
)


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: Batch file rename and move

Comments:

 


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




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge