开发者

Listing Windows file types

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜