My IDLE shortcut in the right click menu has disappeared. I think it's because I used to use Python 2.7, but I installed Python 2.5 without uninstalling Python2.7, and then uninstalled Python 2.5. I found one file named idle.bat, and it works, but that isn't a good way to solve this problem.

  • I though this is because I installed two Python in my computer, then I remove one. Maybe I should try keyword like "How to insert shortcut into right-click menu". Anyway thanks for your help. – Jimmy Oct 6 '11 at 3:35
  • That probably is the reason it went missing, but your question is how to fix it – Michael Mrozek Oct 6 '11 at 4:23
  • You could try to uninstall Python using Revo Uninstaller Freeware, clean up the registry via CCleaner free, then reinstall Python. – harrymc Dec 4 '14 at 7:28

Here's a reg file to add the command to edit with IDLE for Python.File (.py) and Python.NoConFile (.pyw) file types. It's for Python 2.7, installed in C:\Python27, so substitute the paths to pythonw.exe and idle.pyw that are relevant to your installation. Save it to a .reg file. Then right-click and choose Merge.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command]
@="\"C:\\Python27\\pythonw.exe\" \"C:\\Python27\\Lib\\idlelib\\idle.pyw\" -e \"%1\""

[HKEY_CLASSES_ROOT\Python.NoConFile\shell\Edit with IDLE\command]
@="\"C:\\Python27\\pythonw.exe\" \"C:\\Python27\\Lib\\idlelib\\idle.pyw\" -e \"%1\""
  • Hi, I used another way to add the right-click command, but it apply to all my files. Actually, I just want to apply to *.py file. How can I delete the right-click command I added before ? Then I can add your command. Thank you. – Jimmy Lin Oct 6 '11 at 11:19
  • @Jimmy: You can use regedit to inspect HKCR\*\shell, HKCR\*\shellex, HKCR\AllFilesystemObjects\shellex, and so on. This is tedious if you don't find the culprit quickly. Or try a a context menu editor such as ShellMenuView and ShellExView. – Eryk Sun Oct 6 '11 at 12:03
  • Hi, I find the command in the redgit and delete, but I still can't add the right-click command by these two command. I don't know why. I just want to add the command on the right-click menu of *.py and *.pyw file. Thanks again. – Jimmy Lin Oct 7 '11 at 8:27
  • @Jimmy: When you save the above to say idle.reg and right-click the file idle.reg, do you see the option 'Merge'? If that seems to work fine and you confirm that the settings were added, then open a command prompt and check that the output of assoc .py is .py=Python.File. – Eryk Sun Oct 7 '11 at 10:52
  • Hi,actually I didn't see the idle.pyw. I see the idle.bat, so I replace idle.bat with idle.pyw. – Jimmy Lin Oct 11 '11 at 9:57

This worked for me:

(Also view: edit with idle (python gui) context menu windows-7)

  1. open regedit

  2. go to [HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command], if it doesn't exist create it.

  3. copy the following line into the registry:

    "C:\Python27\pythonw.exe" "C:\Python27\Lib\idlelib\idle.pyw" -e "%1"

  4. go to [HKEY_CLASSES_ROOT\Python.NoConFile\shell\Edit with IDLE\command], if it doesn't exist create it.

  5. copy the same line in the the registry:

    "C:\Python27\pythonw.exe" "C:\Python27\Lib\idlelib\idle.pyw" -e "%1"

Note: if your python path is different (e.g. c:/program files/...) then change the paths to match the pythonw.exe and idle.pyw file locations.

This should also work for a clean ActivePython install (to give you that classic idle feel!).


I had the exact same scenario and my fix was to re-run the installer for the current version of python that you have and choose the "repair" option.

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.