Computing.Net > Forums > Windows XP > Rename file ext in many sub-dir using a .BAT

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Rename file ext in many sub-dir using a .BAT

Reply to Message Icon

Name: danielchristie
Date: October 15, 2009 at 12:26:15 Pacific
OS: Windows XP
Product: Microsoft Windows xp professional edition
Subcategory: General
Tags: .bat, ren, DOS
Comment:

How can I rename file extension for files within many subdirectories.

Using the following basic command I can rename file extensions for all files in the same directory:

ren *.mp3 *.adp

But how do I change all files within subdirectories of C:\WINDOWS\Music\Misc?

I greatly appreciate all of your time and efforts, thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: October 15, 2009 at 14:23:21 Pacific
Reply:

@echo off
for /R C:\Windows\Music\Misc %%j in (.) do (
  if exist "%%j\*.mp3" ren *.mp3 *.adp
)


0

Response Number 2
Name: danielchristie
Date: October 15, 2009 at 15:48:40 Pacific
Reply:

Unfortunately this did not do anything to the files within all the subdirectories of \Misc.

Yes, I saved the .BAT file as "all files".

I appreciate your help though, thank you.


0

Response Number 3
Name: IVO
Date: October 16, 2009 at 02:23:01 Pacific
Reply:

Sorry there was a little mistake in the code I posted, replace with

@echo off
for /R C:\Windows\Music\Misc %%j in (.) do (
  if exist "%%j\*.mp3" ren "%%j\*.mp3" "*.adp"
)
 


0

Response Number 4
Name: danielchristie
Date: October 16, 2009 at 10:25:51 Pacific
Reply:

Perfect that did the job. I am deeply thankful, much apprdciated.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Rename file ext in many sub-dir using a .BAT

Deleting files using a .bat www.computing.net/answers/windows-xp/deleting-files-using-a-bat/168232.html

help writing a bat file www.computing.net/answers/windows-xp/help-writing-a-bat-file/172090.html

Ext HD USB2.0 cant use long filenam www.computing.net/answers/windows-xp/ext-hd-usb20-cant-use-long-filenam/99861.html