Mass File Extension Rename

Posted on May 13, 2009. Filed under: Tips & Tricks | Tags: , , , |

Here is how to rename a number of files’ extensions to another extension. Say, for example, some virus renamed all .mp3 files to .jpg files. Now, you need to rename these files back to .mp3 files. You can do this easy.

  • Create a text file, and rename it to, say extren.bat
  • [Right click on the file] > Edit
  • enter the line below and save
  • For /r %%x in (%1) do ren “%%x” %2

Now, if you want to change all .jpg files to .mp3 files, 

  • Put the .bat file into the folder of files’ whose extensions are to be changed.
  • Traverse to that folder in command line
  • Enter extren.bat *.jpg *.mp3

That is, the format of the command is extren.bat *.<from extension> *.<to extension> 

This command changes the extensions of all files that are in <from extension> to <to extension>, in current directory, as well as sub-directories.

Advertisements

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: