如何将文件扩展名关联到程序而不使其成为默认程序 [英] How to associate a file extension to a program without making it the default program

查看:39
本文介绍了如何将文件扩展名关联到程序而不使其成为默认程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在某些系统上部署一个小型转换工具,并希望用户能够通过右键单击打开方式 菜单来运行它.但我不想更改用户与此文件类型关联的默认程序.

I'm deploying a small conversion tool on some systems, and want the users to be able to run it from the right click Open with menu. But I don't want to change the default program users have associated to this file type.

将文件扩展名/类型与程序相关联很容易,但如何在不更改默认程序的情况下(当然以编程方式)做到这一点?

It is easy to associate a file extension/type to a program, but how to do it (programatically of course) without changing the default program?

推荐答案

设置以下键对我有用:

key HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/App Paths/<progname>: "" = <appPath>

key HKCR/Applications/<progname>/SupportedTypes: <fileExt> = ""
key HKCR/<fileExt>: "" = <progID>

key HKCR/<progID>/OpenWithList/<progName>
key HKCR/<fileExt>/OpenWithList/<progName>
key HKCR/SystemFileAssociations/<fileExt>/OpenWithList/<progName>

delete key and subkey at HKCU/SOFTWARE/Microsoft/Windows/CurrentVersion/Explorer/fileExts/<fileExt>

这篇关于如何将文件扩展名关联到程序而不使其成为默认程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆