Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
521 views
in Technique[技术] by (71.8m points)

registry - Where does Windows store its "Open With" settings?

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

HKEY_LOCAL_MACHINESOFTWAREClassesJNLPFileShellOpenCommand

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Take a look in:

HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerFileExts

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...