How do I create a default association for files with an unknown extension?

John Savill

September 14, 1999

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. Files with an unknown extension will bring up an "openwith" dialog when you double click on them however it is possible toassociate an application with files of an unknown type.

You can force this using the registry:

  1. Start the registry editor (regedit.exe)

  2. Move to HKEY_CLASSES_ROOTUnknownshell

  3. From the Edit menu select New - Key

  4. Enter a name of 'open' and press Enter (don't type the quotes)

  5. Select the new 'open' key

  6. From the Edit menu select New - Key

  7. Enter a name of 'command' and press Enter (don't type the quotes)

  8. Double click the (Default) value

  9. Change to the application used to open, e.g. "NOTEPAD.EXE %1" for the notepad.exe application (you need %1 to pass the document name to notepad and depending on the application you may need %1 %*)

  10. Click OK

If you now double click on a file with no extension it will open with theapplication selected.

You can optionally delete the HKEY_CLASSES_ROOTUnknownshellopenas key andits content but it is not necessary and it will just remove the open withcontext menu option.

It is possible to just add a notepad option to the context menu of Unknown byusing the existing entry in HKEY_CLASSES_ROOT/Unknown/shell, adding a new keyvalue of NotePad and a new Key value of 'open' underneath Notepad then a new Keycalled 'command' under open. Set the (Default) value of command to Notepad.exe%1. Registry file to perform this:

REGEDIT4

[HKEY_CLASSES_ROOTUnknownshellotepad]

[HKEY_CLASSES_ROOTUnknownshellotepadopen]

[HKEY_CLASSES_ROOTUnknownshellotepadopencommand]
@="notepad %1"

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like