What is the simplest way of changing a file extension (without messing around with folder view options)?

Oftentimes I have to quickly change the extension of a single file on a Windows PC. I don't like to turn on the option to show file extensions, change the extension, and then turn the option back off. If I forget to turn off the option, the client will not understand how his computer works; this method also involves a lot of clicking. What is the fastest way to change a file extension?

For completness, here the fastest way I have figured out until now:

  • Right click in the folder while holding down the Shift key.
  • Select Open command window here from the menu.
  • Use dir to list the currrent file name with its extension.
  • Enter rename [filename].[oldExtension] [filename].[newExtension].
  • I swear there used to be a trick where you would put a space at the start of the filename with the new extension, or a trailing dot, or something, but I can't get it working with the Windows box I have handy. Commented Jan 20, 2016 at 11:32

4 Answers 4


You could try cmdHere (Power Toys) and then using move filename.jpg filename.jpeg. Or you could Press F2 for rename (If it works with disabled extensions!).

But you should enable extensions anyway. As i would think it is a security risk to have them disabled. An attacker could send you an file like "Really Important Filename".exe With an standard icon included in the .exe making it look like an Word, Excel or Text Document. You might then click it unaware of the .exe file format. THIS is an EVIL feature of Windows.

  • Yes, I disliked it also at the time MS has begun to set this as the default. But now I live with it. However I don't talk about my computer. I talk about computers of my clients. Sometimes I have to do quickly change an extension of a file of one of their computers. And they absolutey don't like it, if I disable this feature. F2 does not work.
    – HCL
    Commented Feb 21, 2011 at 15:59
  • @hcl I have googled it. I think there might be not too much you could do. There is an .exe which creates a Win+Y combo that you could use to toggle the view. But this is not what you want i guess. Anyway an USB-Stick with an autostart option and this .exe might do the trick. Take a look at the link techfuels.com/windows-vista/… it does not change the system it seems, therefore it might be worth to take a look at. Everyone i told why it is evil kept the extensions enabled. Maybe you should talk to your clients
    – Darokthar
    Commented Feb 21, 2011 at 16:09
  • +1 Thanks for your suggestions. I hoped for a hidden operation, somthing with holding the control-key down or so. I assume I will use the command-version. Downloading an app or starting one from an usb-key is not an option. I will wait some time if someone unexpectedly will post a nice solution and if not I will accept your answer. Thanks.
    – HCL
    Commented Feb 21, 2011 at 16:15
  • 1
    No, sadly pressing Shift+F2 or holding Shift does not currently work. In fact pressing Shift+F2 is not even recognized as an attempt to rename (that hotkey is free for mapping) and holding it while selecting Rename from the context menu does nothing special. Microsoft’s insistence of hiding extensions to prevent the basest, stupidest of users from accidentally erasing it makes security people frown.
    – Synetech
    Commented Feb 21, 2011 at 16:37
  • 1
    @hcl I dislike when Windows hides file extensions from you. As you should already know, a Windows executable can use any sort of icon, and this includes icons for documents. The file description and company name can be changed to make the executable look rather like a regular document. Since the .exe extension is hidden, the user will not notice that the so-called "document" is actually an executable that could infect his computer. Commented Sep 10, 2012 at 17:49

I would recommend using the command-prompt as well, but with either of two different methods.

    • Open a command-prompt (I like to set the shortcut in Start->Accessories to have a hotkey like Ctrl+Alt+P to make it quick and easy, though Start->Run->cmd.exe works just as well)
    • Type ren "
    • Drag-and-drop the file in question to the command-prompt window
    • type " " (there’s a space between the quotes)
    • Drag-and-drop the file again
    • Press Backspace and change the extension as desired
    • type "
    • Press Enter
    • Close command-prompt

It looks like a lot, but it is actually not and takes about three or so seconds to do (editing the extension is the most time consuming part).

  1. (supposed to be 2, markdown limitation)
    • Install a program like Kai Li’us CmdOpen (I prefer this to the older Microsoft PowerToys one because it supports elevated prompts and has the source available)
    • Open a command-prompt in the folder where the file in question is contained (right-click on the window where the file is located and press ‘A’ or select Open command prompt
    • Press Tab a few times until the desired filename is displayed
    • Press Space
    • Press Tab again until the filename is displayed again
    • Edit extension
    • Press Enter

This method is also pretty quick, but if there are a lot of files in the folder, using method one is faster.

  • +1 Yes, I have not thought about Drag/Drop. This makes it much easier. Nice...
    – HCL
    Commented Feb 21, 2011 at 16:42

To rename a single file via the command prompt via drag-and-drop:

  • type cmd into the Explorer address bar to open the command prompt
  • type ren then space
  • drag-and-drop the file into the command prompt (note: if the path contains spaces, the command prompt will add double quotes for you)
  • press space
  • drag-and-drop the file again
  • remove the directory, modify the extension
  • press enter
  • type exit and press enter, or use Alt+Space, C, to close the command prompt

e.g. ren C:\MyDir\MyFile.old MyFile.new
e.g. ren "C:\MyDir\My File.old" "My File.new"

Note: This answer is based on Synetech's, but I wanted to clarify handling double quotes and removing the directory from the output path.


Go to folder options and uncheck the option 'hide file extensions'
Now all you have to do is select a file and press f2 and rename the file extension
You can always use command prompt if you are comfortable with it

  • the OP said he doesn't want to have to uncheck the options "Hide file extensions" Commented Feb 21, 2011 at 16:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .