Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 seem to have edited some setting for windows command prompt in windows 7 and forgot.
[EDIT: it was just set as the default application for .py files in windows explorer. Dennis answered it below]

(sidenote: what is the correct way to refer to this prompt? should I call it wondows command prompt? cmd.exe? cmd? ms-dos? dos?)

whenever I enter the path to a python file, it opens that file in an editor (vim) instead of executing it. Where can you edit default actions for filetypes? Why can't I execute a .py file? why does it open an editor instead of executing the file?

Thanks!

share|improve this question
3  
"Windows command prompt" is correct. You can also use "cmd prompt". If you use "ms-dos" or "dos" you're likely to hear objections since it's not technically DOS (however, it quacks and walks a lot like DOS). – Dennis Williamson Feb 5 '11 at 8:22
    
Thank you Dennis – BenjaminGolder Feb 5 '11 at 8:26
up vote 4 down vote accepted

Try the following

assoc | findstr "\.py"

You should get the following results:

.py=Python.File
.pyc=Python.CompiledFile
.pyo=Python.CompiledFile
.pyw=Python.NoConFile

and

ftype | findstr "Python"

should give you:

Python.CompiledFile="C:\Python27\python.exe" "%1" %*
Python.File="C:\Python27\python.exe" "%1" %*
Python.NoConFile="C:\Python27\pythonw.exe" "%1" %*

If any of those are missing, commands such as the following examples should fix them:

assoc .py=Python.File
ftype Python.File="C:\Python27\python.exe" "%1" %*

Also, in Windows Explorer, right click on a .py file and select Open with... and see if it says python.exe or vim.exe. If it's wrong, you should be able to change it there.

share|improve this answer
    
thank you. I tried it and these all returned the expected results - nothing was missing. – BenjaminGolder Feb 5 '11 at 8:37
    
Pipe both assoc and ftype through findstr "vim" to see if anything unusual shows up. Also, in Windows Explorer, right click on a .py file and select Open with... and see if it says python.exe or vim.exe. If it's wrong, you should be able to change it there. – Dennis Williamson Feb 5 '11 at 8:45
    
can you repost the windows explorer suggestion as an answer so I can give it a big fat green check mark? – BenjaminGolder Feb 5 '11 at 8:52
    
@Benjamin: Done. – Dennis Williamson Feb 5 '11 at 8:59
    
thanks again Dennis – BenjaminGolder Feb 5 '11 at 8:59

You must log in to answer this question.

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