Using Notepad++ as default viewer for Internet Explorer View Source

It’s not hard to make Notepad++ the default IE view-source viewer, but by default the viewed source in Notepad++ is seen as plain text since when viewed there is no file extension passed to Notepad++ to hint at the file type.

Here’s a simple way to make Notepad++ work as the default HTML viewer for Internet Explorer, but not lose coloured HTML views. First create a batch file (say called np.bat) containing the following,

START "" "C:\Program Files (x86)\Notepad++\notepad++.exe" -lxml %1

save the batch file to this directory:

C:\Program Files (x86)\Notepad++

Next edit the registry key here to tell IE to use Notepad++ instead of Windows Notepad:

Computer\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\View Source Editor\Editor Name

change the (Default) registry entry above to:

"C:\Program Files (x86)\Notepad++\np.bat"

note: Depending on the version of Windows and IE, some people might find the key is at

Computer\HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\View Source Editor\Editor Name