Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just (finally!) upgraded Python from 2.6 to 2.7, and also installed 3.2 in parallel. I am running Windows Vista.

Before, I could drag-and-drop onto a .py file to run the script, with the dragged file's name appearing in sys.argv. I did nothing to get this behaviour; it worked as soon as Python 2.6 was installed.

It no longer works: the .py file is not recognized as a valid drop target.

I tried this registry hack, which I also found by searching on Google (getting a few scattered references, including an old mailing list thread on It accomplished exactly nothing, even after restarting the computer. I also shouldn't have to do this anyway, since I didn't have to last time.

What is going on? How can I fix it? I really miss having this behaviour.

share|improve this question
What did you drag and drop onto the .py? – Paul Dec 8 '11 at 1:47
A plain text file, which the .py is meant to open and read. Previously, the path to the dropped file was supplied in sys.argv. – Karl Knechtel Dec 8 '11 at 2:25
If you drop text files in a .exe icon, does it run the .exe? People were probably using this as an attack vector and so Microsoft decided to remove the feature in some update. – gcb Dec 10 '11 at 5:23
drag-and-drop to an .exe works fine. I haven't heard of any such lockdown, either. – Karl Knechtel Dec 13 '11 at 19:20

Is it possible that this is a bitness problem, where you are using a 64-bit Explorer, but have installed the 32-bit version of python ? In this case the 64-bit Explorer may not work.

If you have installed Windows 64-bit, you can still test this theory by dropping a file on a .py script using the 32-bit Explorer, which is invoked using this command-line :

%Systemroot%\SysWOW64\explorer.exe /separate


Since you say that this is not the case, then I can only offer as workaround to compile the .py scripts to .exe by using a tool such as py2exe :

py2exe is a Python Distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation.

Question: Did you install python using its installer ?

share|improve this answer
No, I have 32-bit Vista and got the 32-bit Python install (would the 64-bit one even work?). I do not have a SysWOW64 folder in my %Systemroot%. – Karl Knechtel Dec 11 '11 at 16:21
Yes, Python was installed using the official MSI installer from, the same as I did last time with 2.6. – Karl Knechtel Dec 16 '11 at 4:06
Then this is a problem with the installer that you should raise with the python developers on their forum. Until it is fixed, the only workaround I can offer is using py2exe. – harrymc Dec 16 '11 at 12:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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