Windows 7's file association controls have been "simplified" and now I appear to be unable to change the default association of a file (in my case a Python script) to a different executable.

If I right click the script and go to "Open with...", "Choose default program", then "Browse..." and pick the desired interpreter (e.g. C:\Python27\python.exe), it reverts to another--the first--python.exe already in the "Recommended Programs" which is a 2.4 interpreter. There's a second python.exe in there as well, 2.6, but if I explicitly select that program with browse, it still reverts to the first Python in the list.

How do I get back the power of XP?


You can try free Default Programs Editor. I have a good experience with it.

enter image description here


You could always make the change in the registry under:


But I would highly recommend the program Types from Sourceforge for control over all parts of the association process.

  • I had the same problem with Sublime Text 2 and 3 (both use sublime.exe name) and I fixed the problem by changing the HKEY_CURRENT_USER\Software\Classes then navigating to the bottom key and changing the path manually, thanks! Sep 2 '15 at 15:16

Its a workaround, but change the name of the 2.4 python.exe, then try to run a .py. It should though a file not found error. Then browse to the correct file. Feel free to rename the original 2.4 python.exe back to its former name.


I would use Creative Elements Power Tools, specifically the "File Type Doctor".

http://www.creativelement.com/powertools/#download (to download)

http://forums.techarena.in/tips-tweaks/989159.htm (for a screenshot)

This has the advantage of looking almost exactly like the XP file association area, so you would be familiar with it.

  • I am not sure about how this will interact with your python.exe program, but it does give you back the power of XP, as you asked.
    – KCotreau
    Jul 14 '11 at 2:47

Are you sure you are enabling the "Always use the selected program to open this kind of file" check box to the left of the browse button?

enter image description here

This problem shouldn't happen, otherwise. And I can't remember ever witnessing anything similar.

  • Yes, it is checked, and I don't even have to click "OK" to dismiss the program selection window and it "reverts", highlighting the 2.4 python.exe
    – Nick T
    Jul 14 '11 at 2:49
  • Thanks for having replied, Nick. This behavior definitely qualifies as a Windows bug. I'll report it, next opportunity.
    – A Dwarf
    Jul 14 '11 at 3:09

Apart from the manual way to change associations for all relevant extensions described in Juhele's answer, there's a way specifically for Python:

Control panel -> Add or remove programs -> <current default Python installation> -> Change

In the installation wizard that appears, select Change Python <version>. Then the list of installed features appears. We're interested in "Register extensions" (governs double-click action) and "Add python.exe to PATH" (what typing python in console runs):

feature list

You need to uncheck these features for the current default installation and check them for the one you wish to switch to.

This is more manageable a way than editing PATH/associations by hand: this way, you're safe from nasty surprises:

  • the stock file type association wizard may only change the association for the current user
    • then upgrading your installation won't affect the overridden associations
  • when installing/upgrading, the installation wizard acts according to its records and may leave side effects/leftovers if you did something funny without telling it

You can get file association to work the old way prior to windows 7.

(1) Download


(2) unzip, right click executable "run as administrator"

(3) from menu select "tools->file association"

When editing a file association, uncheck "ExOverride" if its set and save. This will stop File Explorer from managing the file association and it will revert back the older Registry Classes method of associating files. If you re-associate the file from explorer, then the ExOverride flag flips back on again. But, you can always rerun this program and flip the ExOverride bit off again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.