Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It used to be possible to set HKEY_CLASSES_ROOT\Unknown\Shell\Open\Command and then any unknown files would open with the specified program instead of seeing that “Open With...” dialog box.

This applies to files with no extension, as well as files with .dat or .xyz or whatever.

This page explains how: Vim Tip 185

Does Windows 7 let you do this?

share|improve this question
up vote 5 down vote accepted

It's still possible to do it this way. However, you must also set the default command for the Unknown key. By default is probably openas, but you can change it. Just set HKEY_CLASSES_ROOT\Unknown\shell default value to Open.

Also, when you change HKCR keys those writes will be directed to their actual location, which is HKEY_LOCAL_MACHINE\Software\Classes. If there exists the same keys in the corresponding per-user location (HKEY_CURRENT_USER\Software\Classes) then that value will be used instead- just changing the HKCR value isn't enough, you'll need to change the HKCU value as well.

share|improve this answer

Based on Factor Mystic's answer, I was able to do this in a way that only requires changing HKCU. I did not want to affect any other users on the device, since I share it with other people.

Here is my file named unknown-files.reg:

Windows Registry Editor Version 5.00

@="Unknown file"



@="c:\\Windows\\write.exe \"%1\""

Just be sure to have open as the default value under the shell folder, and also provide the "%1" after the program's path so it will know which file to open.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .