How to batch change file extensions for Windows files

Posted on February 28, 2008 at 7:07 am

Recently, I came across a problem where I had to change the file extension on a bunch of Windows files from no extension to .JPG. Someone sent me a large number of files, but for some strange reason, they had no file extension, even though they were images! Once I added the .JPG extension to the end of the file, I was able to open the images.

There are many other reasons why you may need to rename file extensions, so I’ll show you how you can change them one at a time if you have a small number of files or batch rename file extensions if you have lots of files.

If you’ve gotten an email with an attachment with no file extension, the file may look like this and when you try to open it, may ask you to choose from a list of programs:

file extensions

Obviously, since there is no file extension for the file, Windows is not able to determine which program should open it. If you want to change the file extension for the file, you first need to be able to see file extensions in Windows. You can do this by going to My Computer and then going to Tools and  Folder Options.

tool folder options

Go to the View tab and scroll down till you see the option “Hide extensions for known file types“. Go ahead and uncheck it.

hide know file types

If the file has no extension at all, this step may not be necessary, but I am including it because if you’re trying to CHANGE the file type from one type to another, then you need to do this. Now right-click on your file and choose Rename.

reanme files

Move to the end of the name and type in .XXX or whatever the type is for the file you want it to be, i.e. .TXT for text files, .XLS for Excel files, etc. Obviously, the file has to have originally been from that program that you are changing the file extension too. In my case, the text file was from Excel and I removed the file extension, now I’ll add it back.

rename file

How to batch rename file extensions

So how do you rename multiple file extensions at once? If you have a directory full of files that need to be changed from .PNG to .JPG, it’s going to take forever to do this using the method above. That’s where you need a freeware application that can batch change file extensions for you.

Extension Renamer is a simple to use, freeware program that I have tested and contains no spyware, etc. Once you install it, it’s a piece of cake to change file extensions!

file extension changer

First, click Select Directory and choose the directory that contains all of the files that you want to modify. You have the option of including subdirectories also. Then you search for files with particular file extensions that you want to change. The *.* means that it will change ALL files to the new extension.

You can type in your the extension you want to change, such as .TXT in the From box along with an asterisk (*) or question mark (?) to help filter down the files. Click Search and the files that will be changed show up in the left box. Once you are satisfied, go ahead and click GO! Now all of your files will have their extensions renamed.

And that’s it! Any questions, post a comment! Enjoy!

[tag]changing file extensions, change file extension, rename file extensions, batch rename file extensions, mass rename file extensions[/tags]

» Filed Under Computer Tips

Related Posts

Comments

29 Responses to “How to batch change file extensions for Windows files”

  1. Danny V said on :

    I try to use it but when I click GO, I get a runtime error. That’s a shame, it could be a really good tool.


  2. akishore said on :

    Danny, what runtime error do you get with the program? Also, what OS version are you running?

    Thanks


  3. tsberry said on :

    There’s an easier way (in Vista):

    Shift-right-click in the folder containing the files to be renamed

    Click on “Open Command Window Here”

    In the Command Window, type the DOS command for file renaming, as applicable: ie: ren *.jpg (to set the extension for all files in that directory to “jpg”)


  4. Michael said on :

    found your site today and downloaded the program.
    Works GREAT with some limitations
    at least in my aapplication)
    We had to change 5879 files from a printmaster “let” xtension to a “sig” xtension
    it would only do 39-43 changes at a time,and in the “from” box…once it would change the number of extensions that it did…you would have to change back the origional extension that you were trying to change… ctrl+v is good. Furthermore lets say someone wrote the file name as:
    j comelately.let (printmaster file) it would confuse the renamer and it would rename it:
    j.let (I’m assuming because of the space between the
    j and “comelately”.
    Further if there is to many periods at the end of the name (ie)jcomelately dr…let (”dr” as an abbreviation for drive then more than one period) it would have difficulties.
    in a perfect scenerio i think this is a wonderful program.
    M


  5. Jerry said on :

    Hi! to all expert!

    I have question in renaming files i.e. word or excel.

    I usually do like this “right click” the mouse and choose rename… and then type a new file name without adding the extension file i.e. “.doc” for word and “.xls” for excel. And yet, everytime I rename a file I am prompted error such as “IF YOU CHANGE A FILE NAME EXTENSION THE FILE MAY BECOME UNUSABLE. ARE YOU SURE YOU WANT TO CHANGE IT?” Yes or No!

    I opted YES! then it changed different icon on my file(unrecognized icon) and certainly unusable as I could not open the file and says CORRUPT! when I rename it adding the extension file it works! i.e. the new file name in excel is Monthly Report so I have to type Monthly Report.xls – it works this way. BUT previously you don’t need to add the extension file and it will autoadd/fill when you save the file.

    Does anyone has an idea? I am using Windows XP Professional (OS), and MsOffice 2003. The same problem with my PC at home with O.S. Windows Vista Ultimate and 2003 MSoffice.

    Any advise is very appreciated.

    Jerry


  6. Justin said on :

    I have a question. I need to change a video file from my phone (which has the extension 3GP) into a different extension so that I may edit the video file(s).

    I have tried a fair few times with the method given, although every time I do the file becomes corrupt or invalid. I have tried a few different types of movie file extensions (such as .avi or .mp2) and none of them seem to work.

    Any explanation as to why this is happening, or a different way i can change the file(s) to a different movie extension would be greatly appreciated.

    E-mail me at poli910@hotmail.co.uk if possible, as I may not check here.

    Thank you,

    Justin H.

    P.S. Good route given here for showing how to change file extensions!


  7. aaronmeister said on :

    WOW! Works like a charm – Much easier and user friendly than using the Command Prompt – I changed the extension on over 400 video files in less than three minutes. Thanks for the heads up!


  8. expert said on :

    if you have winxp or win vista, just open a command window,
    enter into your directory and type

    ren *.dat *.mpg

    this will change all files with extension .dat to .mpg.
    super easy!


  9. Si3Si3 said on :

    PS

    if you have a folder with different file of types (eg jpg/bmp/gif/ico/tga) and want to change ALL files to One type (eg png) then type:

    ren *.* *.png

    NB – All files in folder WILL change to .png!!


  10. Fath said on :

    hi Jerry
    you have to hide the file extensions, to do so:
    open any folder, go to “Tools”, select “Folder options”
    find the option “Show extension for known file types”, this one must be ticked in your computer, un-check it and you should get only the names of the files without the extension.


  11. Dawn said on :

    Hey! Thanks for the help!

    But I have a problem here… There isn’t any option as “Folder Options” in the Tools Menu. The menu just shows three options, Map Network Drives, disconnect them, and synchronize. Why isn’t the fourth option visible?


  12. djz said on :

    Here is a statement you can use in a command prompt to accomplish the same thing. Be sure to test it first.

    for /f %x IN (’dir /b’) DO ren %x %x.new

    Use FOR /? to see the complete documentation on the command. There is a slight difference for batch file usage.


  13. djz said on :

    Note that my previous suggestion just adds a file extension, it will not change an existing extension.


  14. Goodguy said on :

    tsberry, thanks for the Vista tip!


  15. NR said on :

    Sir, Thank you for the batch rename information. Like yourself, I would like to rename pic files that have no extension. I don’t understand how this can be accomplished with the Renamer utility. Seems as though I need an extension to begin with. Can you help?

    Thanks
    NR
    Washington DC


  16. dave seeley said on :

    I love you, man. thanks a million…files that is.


  17. azhar said on :

    Hi! to all expert!

    I have question in renaming files i.e. word or excel.

    I usually do like this “right click” the mouse and choose rename… and then type a new file name without adding the extension file i.e. “.doc” for word and “.xls” for excel. And yet, everytime I rename a file I am prompted error such as “IF YOU CHANGE A FILE NAME EXTENSION THE FILE MAY BECOME UNUSABLE. ARE YOU SURE YOU WANT TO CHANGE IT?” Yes or No!

    I opted YES! then it changed different icon on my file(unrecognized icon) and certainly unusable as I could not open the file and says CORRUPT! when I rename it adding the extension file it works! i.e. the new file name in excel is Monthly Report so I have to type Monthly Report.xls – it works this way. BUT previously you don’t need to add the extension file and it will autoadd/fill when you save the file.

    Does anyone has an idea? I am using Windows XP Professional (OS).

    Any advise is very appreciated
    azhar


  18. hdjunkie said on :

    How about run…cmd
    cd wherever
    rename *.new *.old?


  19. Patrick Mc said on :

    You can use biterscripting (http://www.biterscripting.com for free download) for batch renaming files, also batch copying, moving, editing, deleting, files.

    Patrick


  20. Joe said on :

    It’s been said in different ways from previous posters, but just to show another easy way on Vista to change multiple files that already have a file extension to a different file extension, do the following. As far as I know, this is the least amount of typing using command prompt to accomplish this task.

    1) Shift + Right Click in the folder containing the files who’s file extensions you wish to change.

    2) Inside the command prompt type “ren * *.(your file extension)”

    So to change my .jpg files to .PNG I did “ren * *.png”.

    …and presto, chango, all your file extensions now have been changed to the one you specified in the command prompt. To give credit where it’s due, I figured this out by fiddling with the code tsberry posted and adding the additional * before *.(your file extension).

    What a great solution! Saves me SO much time. I wish I had found this out years ago…


  21. Corey said on :

    I have created a Excel picture file with pics and text. I am trying to take this file and transfer it to a photo sharing jpg. I am unable to do this as the file won`t show when i search in the browse my system from the sharing site. I am sure the extension is the problem and won`t display it. I still don`t know how to make it work and get the format i need for it. What can i do?


  22. Toy Yoda said on :

    This is pretty cool. But what do you do if your files have number padding? I tried using Extension Renamer and it does not allow for this. For example, if your files are named like the following, the program treats the numbers like the extension, but it is not the extension.

    file.001
    file.002
    file.003
    file.004

    Everytime the program changes the file name into a jpeg it does this:

    file.jpg

    …as opposed to this:

    file.001.jpg

    Thus the program freezes. Does anyone have a workaround for this? It is especially frustrating if you have many images as part of an animation. The files need to be sequenced as above. But I often encounter a batchof images that have the number padding but not the extenion. What to do?

    TX,

    Toy Yoda


  23. badbob said on :

    Extension Rename works where commandline fails! Apps that generate thumbnail files for videos will create files like my_video.avi.jpg. I need it to be my_video.jpg.

    ren *.avi.jpg *.jpg

    does not work in this scenario but Extension Rename does. Cool!


  24. Sweatyarmpit said on :

    @ Toy Yoda

    Throw all the files that should be renamed in one folder. Shift+right click the folder and select “Open command window here”.

    Insert the following:

    ren *.0** *.jpg

    All files should be renamed correctly…


  25. habeyhl said on :

    Thanks for the heads up on Extension Renamer. It’s a little particular about your file structure (i.e., all the files in the directory it’s working on need to be of the same extension for it to work) – but it did the job!

    Thanks,
    -habeyhl
    (follow me on Twitter @habeyhl)


  26. Anonymous said on :

    If all the files are of the same extension then you can do it via the command prompt as well. I recently wanted to change a large (read 500+) group of .rar’s to the .cbr (comicbook reader) file extension. I simply navigated to the directory via the cmd prompt and did ren *.rar *.cbr worked like a charm in less than 10 seconds. Hope this helps.


  27. C.J. said on :

    For everyone using this program, PLEASE remember that this program simply changes the extension. It does not replace the process of converting files, such as music and video files. Those are files in a different format altogether. Look for a converter for the respected files instead of trying to rename them. It won’t work.


  28. Scuba Steve said on :

    To fix a directory containing files needing an extension in Windows 7 it is similar to Vista. No files can be selected/highlighted while doing this.

    While holding Shift, right click in the directory containing the files, click on “Open command window here”. Type the following: “rename *. *.ext” Without the quotes and ext being the extension you want to use. This is assuming all files in the same directory need the same extension assigned.


  29. Darius said on :

    Thank you sir.

    Im in process of building a site and need to change all ext from html to php.

    Thx for this excellent article.

    Regards,
    D


Please post your comments/suggestions!