How do I get ftype & assoc to match Windows Explorer?

Posted by Gauthier on Super User See other posts from Super User or by Gauthier
Published on 2010-10-28T14:31:25Z Indexed on 2012/11/15 17:06 UTC
Read the original article Hit count: 257

I changed the association to use upon launching a .py file, via Windows Explorer:

  1. Tools -> Folders -> File types.
  2. Then browse to .py.
  3. Change the association to Wordpad.

Now when I type the name of a py file in the command line, Wordpad opens it.

But assoc and ftype in the command line still return the following:

C:\> assoc .py
.py = Python.File

C:\> ftype Python.File
Python.File = "C:\Program\Python27\python.exe" "%1" %*

How come the association is working, but assoc and ftype are not aware of it?

I did restart the prompt.


More info from my registry:

HKEY_CLASSES_ROOT\.py
= Python.File

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.py\Application
= wordpad.exe

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.py\OpenWithProgids\Python.File
= 

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.py\(Standard)
= Python.File

More registry:

HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command\(Standard)
= "C:\Program\Python27\python.exe" "%1" %*`

I suppose this is what is showing up in ftype Python.File. But it does not seem to get used.


(I am doing this for testing, so I can eventually choose my default version of Python easily).

© Super User or respective owner

Related posts about windows-xp

Related posts about file-association