如何判断一个特定的文件扩展是否有一个默认的程序来打开它?例如:PDF,在Windows 7。

时间:2022-09-02 15:51:17

I want to know if there is a specific entry to check in the registry to see if there is a default program associated with a specific file type?

我想知道是否有一个特定的条目在注册表中检查是否有与特定文件类型相关联的默认程序?

My main example would be a PDF. Documentation in my company is mainly PDF. We want to be able to distribute the latest Adobe Reader because, generally, a lot of the PCs using my company's software will not have access to the internet.

我的主要例子是PDF。我公司的文件主要是PDF。我们希望能够发布最新的adobereader,因为一般来说,使用我公司软件的许多个人电脑将无法访问internet。

During installation, I want to be able to check if the computer we are installing on already has a program to view PDF files. If yes, carry on. if not, then run the Adobe distribution as part of the install.

在安装过程中,我希望能够检查我们安装的计算机是否已经有一个可以查看PDF文件的程序。如果是,继续。如果没有,那么运行Adobe发行版作为安装的一部分。

I'm focused on Windows 7 PCs, registry entry(ies) I can read programatically to see if, as an example, PDF has a valid program to open it.

我关注的是Windows 7个人电脑,注册表项(ies),我可以通过编程的方式阅读,看看是否,作为一个例子,PDF有一个有效的程序来打开它。

2 个解决方案

#1


1  

No this option not exists. Although HKCR\'PROGID'\shell\open may points to the installed software.

没有这个选项不存在。虽然HKCR\'PROGID'\shell\open可以指向已安装的软件。

User MC ND have wrong answer. See my screenshot:

用户MC ND有错误的答案。看到我的截图:

如何判断一个特定的文件扩展是否有一个默认的程序来打开它?例如:PDF,在Windows 7。

During installation, I want to be able to check if the computer we are installing on already has a program to view PDF files. If yes, carry on. if not, then run the Adobe distribution as part of the install.

在安装过程中,我希望能够检查我们安装的计算机是否已经有一个可以查看PDF文件的程序。如果是,继续。如果没有,那么运行Adobe发行版作为安装的一部分。

So I have pdf reader (!!!) with no associations. MC ND you are still thinks, I have no pdf reader?

所以我有pdf阅读器(!!! !)没有关联。你还在想,我没有pdf阅读器?

#2


-1  

From console

从控制台

assoc .pdf to get the "fileType" associated to the extension. Once you have the fileType (ex. AcroExch.Document.11):

assoc .pdf以获取与扩展相关的“文件类型”。一旦你有了fileType (ex. acroexch.document.document.11):

ftype AcroExch.Document.11 to get the associated program.

ftype AcroExch.Document。要得到相关的程序。

#1


1  

No this option not exists. Although HKCR\'PROGID'\shell\open may points to the installed software.

没有这个选项不存在。虽然HKCR\'PROGID'\shell\open可以指向已安装的软件。

User MC ND have wrong answer. See my screenshot:

用户MC ND有错误的答案。看到我的截图:

如何判断一个特定的文件扩展是否有一个默认的程序来打开它?例如:PDF,在Windows 7。

During installation, I want to be able to check if the computer we are installing on already has a program to view PDF files. If yes, carry on. if not, then run the Adobe distribution as part of the install.

在安装过程中,我希望能够检查我们安装的计算机是否已经有一个可以查看PDF文件的程序。如果是,继续。如果没有,那么运行Adobe发行版作为安装的一部分。

So I have pdf reader (!!!) with no associations. MC ND you are still thinks, I have no pdf reader?

所以我有pdf阅读器(!!! !)没有关联。你还在想,我没有pdf阅读器?

#2


-1  

From console

从控制台

assoc .pdf to get the "fileType" associated to the extension. Once you have the fileType (ex. AcroExch.Document.11):

assoc .pdf以获取与扩展相关的“文件类型”。一旦你有了fileType (ex. acroexch.document.document.11):

ftype AcroExch.Document.11 to get the associated program.

ftype AcroExch.Document。要得到相关的程序。