How can a Java program get the list of File Types in Windows (those listed in Control Panel/Folder Options/File Types)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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
regcommand. For example, in a Command Prompt type the following command to list out the file extensions.To execute this from a java program, use a ProcessBuilder.