Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 3 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

Your Answer

 
discard

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.