[Fix] Save As dialog adds double extensions when saving files

When you use the Save or Save As dialog in various programs and type a file name and click Save, the file name may contain double extensions. For instance, if you use your text editor to create a .php file, and save it, the file may be saved as filename.php.txt.

Which results in this:

Solution: Save As dialog adds double extensions when saving files

To prevent the Save As dialog from adding double extensions to a file, there are three methods:

Option 1

In the Save as dialog, type the file name and select “All files” in the “Save as type:” drop-down before clicking save. However, not all programs will show the “All files” option in the Save as dialog.

Option 2

In the Save as dialog, enclose the file name within double quotes, such as "signup.php" instead of signup.php

Option 3

It’s been noted that Windows adds double extensions only if the file type is not registered. For example, .php file extension isn’t registered or associated by default, and Windows adds double extension in this case.

Use one of these methods to add .php to the list of registered file extensions. You don’t have to associate it with a program compulsorily — adding the extension in the registry should suffice. The following command is for .php file type:

Open a Command Prompt window, and type:

reg add hkcu\software\classes\.php

Press Enter.

To apply the setting for all users in the system, open an admin Command Prompt, and type this command:

reg add hkcr\.php

Press Enter.

Alternatively, you can use the Registry Editor to add the file extension.

  1. Launch regedit.exe
  2. Select the HKEY_CLASSES_ROOT key.
  3. From the Edit menu, click New, click Key.
  4. Name the key accordingly (e.g., .php — with the leading dot.)
  5. Exit the Registry Editor.

Windows will now know that .php is a registered file type, and the Save As dialogs should no longer add double extensions when creating/saving as a .php file.

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

Leave a Comment