14

I have a number of files on my Windows 7 machine with .htm extensions. When I right click on these files I get a menu of options (Open/Edit/Print etc.) The EDIT option is currently mapped to Microsoft Word and I want to map it to Notepad.

I have tried right clicking on the file and selecting Open With/Choose default program but that only lets me set the program for the Open menu item not the Edit menu item. I have also tried Start/Default Programs/Associate a file type, but this also only lets me change the Open option.

Any ideas? I am sure I used to be able to do this in Windows XP.

0

6 Answers 6

12

To change it without using 3rd party software:

Open Internet Explorer. Go to Tools > Internet Options. Select the Programs tab. Change the 'HTML Editing' option to whatever you want to use (e.g. Notepad).

5
  • 3
    Talk about hiding the setting away where you won't find it. I would never have thought to look there in a million years. Mar 16, 2011 at 9:37
  • Apparently it works only with MS programs (Word, Notepad, Excel !?)
    – Liviu
    Jun 24, 2013 at 12:16
  • By using this method, the only way to use a custom program (other than ms) is to go into HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Default HTML Editor\shell\edit\command and change the value for your favorite editor path
    – Thermech
    Oct 31, 2013 at 15:40
  • I just used this to change the option (Word kept trying to open in Safe mode and failing anyway) and was pleasantly surprised to see TextPad in the available options.
    – stuartd
    Jun 25, 2014 at 9:53
  • Another registry key that needs to change to use a custom program is: HKEY_CURRENT_USER\Software\Microsoft\Shared\HTML\Default Editor\shell\edit\command. This is the key windows explorer reads to open a html file with 'Edit'. Mar 9, 2016 at 11:53
6

Reccommending Default Programs Editor for this, because along with many other features, it was designed for Vista/Windows 7 and plays nice with UAC.

The context menu editor is quite powerful, allowing you to add or edit context menu items without hassle:

Context Menu Editor

Additionally, it allows you to remove that 'default programs' association that Windows won't let you un-check:

Uncheck default programs

2
  • 2
    I second this one. I like how it integrates with the control panel, as well.
    – Uninspired
    Mar 16, 2011 at 2:30
  • I like it when people hack registry hacking. ;) +1 for the screenshots. @Factor Mystic Sep 23, 2019 at 16:17
4

I've used FileTypesMan on several occasions and it has performed as expected (opening in its own window but performing the same task)

1

the problem here is not file association, unless you want to associate Notepad as the default program to open all HTML files (rather than your web browser).

i recommend this method instead:

1. Enter the program's executable name (notepad.exe) as a subkey of these two registry key's shown below:

[HKEY_CLASSES_ROOT\.htm\OpenWithList\notepad.exe]
[HKEY_CLASSES_ROOT\.html\OpenWithList\notepad.exe]

2. And add an "edit" subkey here:

[HKEY_CLASSES_ROOT\Applications\notepad.exe]
[HKEY_CLASSES_ROOT\Applications\notepad.exe\shell]
[HKEY_CLASSES_ROOT\Applications\notepad.exe\shell\edit]
[HKEY_CLASSES_ROOT\Applications\notepad.exe\shell\edit\command]
Default = C:\WINDOWS\notepad.exe "%1"

3. To change the default editor, replace the "Default" entry in this registry key with the command line for your prefered editor:

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Default HTML Editor]
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Default HTML Editor\shell]
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Default HTML Editor\shell\edit]
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Default HTML Editor\shell\edit\command]
Default = C:\WINDOWS\notepad.exe "%1"
0

Creative Element Power Tools includes a File Type Doctor program that can do it...

alt text

0

Save this in a batch file Add Edit Command To HTM.bat & run:

reg add "HKCR\SystemFileAssociations\.htm\shell\Edit\command" /ve /t REG_SZ /d "notepad.exe \"%%1\"" /f
pause

This adds an Edit command to the .htm file context menu to be open with Notepad.

If you don't have Notepad in PATH, then put full path to Notepad instead of notepad.exe

The SystemFileAssociations is the location where you specify for example the .htm file type association for context menu and in the shell you put the Edit command.

You must log in to answer this question.

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