views:

60

answers:

3

I'm trying to programatically check file associations (for example .jnlp files). I keep reading that "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\JNLPFile\Shell\Open\Command" is the place to check. However, if you change the association through windows explorer (Open With > Choose Program > (Always use the selected program)), the change isn't at all reflected in this registry key. Where else is this information stored?

+1  A: 

On:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jnlp\OpenWithList

Tip: Edit>Find is pretty handy at these situations. :)

Ruel
+4  A: 

Take a look in: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\

and the sub-key of that is the extension you reassigned. Under that there will be the UserChoice and OpenWithList sub-keys which will contain your redefinition.

You may also want to read http://support.microsoft.com/kb/950505 which talks about your issue.

Michael Goldshteyn
Thanks, just what I was looking for.
mitch
A: 

This is a two-part look-up.

First, you look up the default value of HKEY_CLASSES_ROOT\[file_extension]. For your extensions, .jnlp, the value is "JNLPFile". Let's call this the [file_descriptor].

Now you can look up the default value of HKEY_CLASSES_ROOT\[file_descriptor]\Shell\[command]\Command (where [command] is the shell command you are interested in: open, print, etc.).

Chris Judge

related questions