Where does Windows store its "Open With" settings?
Asked Answered
B

3

41

I'm trying to programmatically check file associations by the file extension (for example .jnlp files). I keep reading that

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\JNLPFile\Shell\Open\Command

is the Registry key 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?

Bicknell answered 13/10, 2010 at 14:27 Comment(0)
T
36

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.

Update

As of Windows 8, life has gotten far more complicated. To create an extension association a custom hash needs to get calculated.

Fortunately, someone has reverse engineered the process and created a PowerShell script to do this without having to go through any GUI.

You can find it at the following GitHub link:

https://github.com/DanysysTeam/PS-SFTA

Thaumatrope answered 13/10, 2010 at 14:35 Comment(0)
C
9

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\[action]\command (where [action] is the shell action you are interested in, e.g.: Open, Print, Edit, etc.).

Cupreous answered 13/10, 2010 at 14:38 Comment(0)
V
3

On:

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

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

Verbal answered 13/10, 2010 at 14:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.