Windows 在哪里存储其“打开方式”设置?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3924753/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where does Windows store its "Open With" settings?
提问by mitch
I'm trying to programmatically check file associations by the file extension (for example .jnlp
files). I keep reading that
我正在尝试通过文件扩展名(例如.jnlp
文件)以编程方式检查文件关联。我一直在读那个
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\JNLPFile\Shell\Open\Command
is the Registry key to check. However, if you change the association through Windows Explorer:
是要检查的注册表项。但是,如果您通过 Windows 资源管理器更改关联:
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?
更改根本没有反映在此注册表项中。这些信息还存储在哪里?
采纳答案by Michael Goldshteyn
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.
其子键是您重新分配的扩展名。在此之下将有 UserChoice 和 OpenWithList 子键,其中将包含您的重新定义。
You may also want to read http://support.microsoft.com/kb/950505which talks about your issue.
您可能还想阅读讨论您的问题的http://support.microsoft.com/kb/950505。
回答by Chris Judge
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].
首先,查找 HKEY_CLASSES_ROOT\[file_extension] 的默认值。对于您的扩展名 .jnlp,值为“JNLPFile”。我们称之为 [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.).
现在您可以查找 HKEY_CLASSES_ROOT\[file_descriptor]\Shell\[action]\command 的默认值(其中 [action] 是您感兴趣的 shell 操作,例如:打开、打印、编辑等)。
回答by Ruel
On:
在:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jnlp\OpenWithList
Tip: Edit>Find is pretty handy at these situations. :)
提示:编辑>查找在这些情况下非常方便。:)