There are situations where you need to open plain-text files with unknown or unregistered file extension, using Notepad or any other text editor. No file association exists for extension-less files and files with unknown extension in Windows. So, to open those files, you use the Open With option and select Notepad from the list.
And, it becomes even more difficult if Notepad is not readily available in the “Open with” sub-menu, in which case you need to browse to select Notepad.exe in the Windows folder every time.
Adding the Open with Notepad option in the context menu (for all files) makes the job easy — will save you a couple of mouse clicks every time.
Add “Open with Notepad” option to the right-click menu
To add the Open with Notepad command in the right-click menu for all file types, use the .REG file below which creates the required registry keys and values for you, under the following branch.
Note that the * above is not a Wildcard, but an explicit asterisk. (*)
1. Download openwithnotepad.zip and save it to Desktop
2. Unzip the contents (two .reg files) to a folder
3. Right-click the file openwithnotepad.reg and then choose Merge. This adds the “Open with Notepad” entry to the context menu for all files, regardless of the extension.
In Windows Vista and earlier, the icon for Notepad won’t appear in the context menu (as in Fig 1). That’s because the context menu icon feature was first introduced in Windows 7 only. In Windows Vista, the context menu appears as in the image below.
If you plan to remove the Open With Notepad option at some time, run the file undo-openwithnotepad.reg.
Registry file contents
Here is the contents of the REG file in case you want to make your own.
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Notepad] @="Open with Notepad" "Icon"="notepad.exe,0" [HKEY_CLASSES_ROOT\*\shell\Notepad\command] @="notepad.exe \"%1\""
Add “Open with Notepad” as an extended context menu
If you want the “Open with Notepad” option to appear only when using the SHIFT key during right-click, you can implement it as an extended item, by adding a registry value named “Extended” — here is another REG file that does it automatically.
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Notepad] @="Open with Notepad" "Icon"="notepad.exe,0" "Extended"="" [HKEY_CLASSES_ROOT\*\shell\Notepad\command] @="notepad.exe \"%1\""
Copy the above contents to Notepad, and save the file with a .reg extension, say “openwithnotepad2.reg”. Double-click to run the file.
Note: Be aware that opening binary files such as .exe, .dll, .com etc. using Notepad and accidentally saving them would cause the files to become corrupt, and they’ll no longer run. Use this Open with Notepad only for files containing text content.
The registry edits work in all versions of Windows, from Windows 2000/XP through Windows 10.
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.