0

I have the string of the file extension. And I think the question is self explanatory

Edit:
- unknown to the computer (windows); A file for which there is no default program installed

vhoyer
  • 764
  • 8
  • 16
  • It isn't. What does 'unknown' mean? Unknown to who? Some list you have? Windows? Google? – Charles Mager May 15 '16 at 17:29
  • What exactly do you mean by "unknown file type"? A file for which there is no default program installed? – ChrisF May 15 '16 at 17:29
  • The string of "the" file extension. What file extension? – Dan Cundy May 15 '16 at 17:31
  • @ChrisF A file for which there is no default program installed – vhoyer May 15 '16 at 17:33
  • check this answered question for some lead. [link](http://stackoverflow.com/questions/162331/finding-the-default-application-for-opening-a-particular-file-type-on-windows) – Oogway May 15 '16 at 17:37
  • I love the "And I think the question is self explanatory"...and then you have had to edit your question because it was no where near self explanatory. – Dan Cundy May 15 '16 at 17:38

1 Answers1

2

Directly under HKEY_CLASSES_ROOT in the registry there are a series of keys that are common (and not so common) file extensions.

In the first instance if the extension key doesn't exist then it's truly unknown to the system.

Under each of those keys there can be other keys:

  • PersistentHandler
  • OpenWithList
  • OpenWIthProgIds
  • ShellEx
  • etc.

depending on what type of file it is.

The presence of one (or more) of these keys will tell you whether the system can open the file and what program(s) are installed that can.

You access a registry key via the RegistryKey class

For instance if you call OpenSubKey with the name of the extension it will tell you whether it exists or not by whether the call succeeds or fails. If it succeeds you can then check the subkeys to see what program (if any) can open the file.

ChrisF
  • 134,786
  • 31
  • 255
  • 325