开发者

Listing Windows file types

开发者 https://www.devze.com 2023-03-04 21:30 出处:网络
How can a Java pro开发者_如何学Pythongram get the list of File Types in Windows (those listed in Control Panel/Folder Options/File Types)?The list of all registered file types is present in the regist

How can a Java pro开发者_如何学Pythongram get the list of File Types in Windows (those listed in Control Panel/Folder Options/File Types)?


The list of all registered file types is present in the registry under the HKEY_CLASSES_ROOT key. If the key begins with a . it is a registered file extension.

Take a look at MSDN > File Types for more information about how they are stored in the registry.

You can query the registry using the reg command. For example, in a Command Prompt type the following command to list out the file extensions.

reg query HKEY_CLASSES_ROOT | find "HKEY_CLASSES_ROOT\."

To execute this from a java program, use a ProcessBuilder.

0

精彩评论

暂无评论...
验证码 换一张
取 消