Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

[HKEY_CURRENT_USER\Software\Classes\Unknown]
@="Unknown file"

[HKEY_CURRENT_USER\Software\Classes\Unknown\shell]
@="open"

[HKEY_CURRENT_USER\Software\Classes\Unknown\shell\open]

[HKEY_CURRENT_USER\Software\Classes\Unknown\shell\open\command]
@="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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.