Shell extensions for file names with no file extension can be registered under the following:
For example, to associate a program (for example, Notepad.exe) to open all files with no extension, use the following registry keys:
[HKEY_CLASSES_ROOT\.] @="" [HKEY_CLASSES_ROOT\.\shell] [HKEY_CLASSES_ROOT\.\shell\open] [HKEY_CLASSES_ROOT\.\shell\open\command] @="<path to notepad.exe> %1"
Here is an alternative method:
[HKEY_CLASSES_ROOT\.] @="NoExtFile" [HKEY_CLASSES_ROOT\NoExtFile] [HKEY_CLASSES_ROOT\NoExtFile\shell] [HKEY_CLASSES_ROOT\NoExtFile\shell\open] [HKEY_CLASSES_ROOT\NoExtFile\shell\open\command] @="<path to notepad.exe> %1"
NoExtFile” is not a predefined name, and therefore it can be anything. Adding other shell extensions is similar to adding shell extensions for file names with extensions.
This article was previously published under Microsoft KB Q236014, titled “INFO: Shell Extensions for File Names with No File Extension.”
Whereas, implementing the menu under the following key shows the menu for all file types — including the extension-less files.
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.\shell\openwithnotepad] @="Open with Notepad" [HKEY_CLASSES_ROOT\.\shell\openwithnotepad\command] @="c:\\windows\\notepad.exe \"%1\""
The above registry file adds the following registry keys and values:
The Notepad entry is now shown in the right-click menu for extension-less files (only).
As there are no other menu entries, the Notepad option will be the default — i.e., double-clicking a file with no extension opens it in Notepad. If you don’t want to make it the default context menu option, you’ll have to add the
NeverDefault registry value, as below:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.\shell\openwithnotepad] @="Open with Notepad" "NeverDefault"="" [HKEY_CLASSES_ROOT\.\shell\openwithnotepad\command] @="c:\\windows\\notepad.exe \"%1\""
The above registry file adds the custom menu item but doesn’t make it as the default — i.e., “Open with” remains as the default option.
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!