I don't know why I didn't think of replacing Notepad.exe until now. I have much better editors like NoteTab and Metapad on my laptop, but I left Notepad in place and resorted to opening those files by drag-n-drop or open dialog because every software out there, including IE's view source, resorted to invoking notepad.exe to display files.
I finally had enough of crappy Notepad.
I chose Sc1, a special build of freeware open source text editor SciTE which is based on open source and platform-independent Scintilla text editing component, because Sc1 packs everything into a single EXE and has a small footprint (230K). The downloaded file is the Sc1 executable file, not an installable package. It's just ready to go and comes with syntax coloring support for most common text file types like HTML, Java, Perl, Python, XML, etc.

HTML file in outliner mode

Perl source file
How to replace Notepad.exe on Windows XP
Windows XP has file protection so Notepad.exe will get restored if you just replace the file with renamed Sc1.exe. Follow these steps:
-
Download Sc1.exe from SourceForge and rename it to Notepad.exe
-
Save a copy of the original Notepad.exe somewhere.
-
Replace Notepad.exe in following three locations (order is significant):
-
%WINDIR%\\System32\\DllCache
-
%WINDIR%\\System32
-
%WINDIR%
*%WINDIR% is your Windows folder (i.e. C:\\Windows)
-
-
Press Cancel when a warning dialog appears.
That's it. Enjoy.
Update #1:
If you are using Sc1.exe as Notepad.exe replacement and you are not happy with the default settings, drop this copy of SciTEGlobal.properties into System32 folder. This config file changes default font to be monospaced and raises font size from 10 point to 12 point for my large screen and lowers tab size from 8 to 4. The config file is amply documented so please do play with it. For more documentation, visit the SciTE website. You might also want to download the regular version of SciTE to get other property files to drop into System32 folder.
I know this is rather user-unfriendly, but I like the configurability of SciTE and the fact that I can ultimately make any change I want with the source code.
Update #2: 2003/10/06
David Schontzler wrote a batch file script to automate the installation process:
@echo off
@echo Backing up notepad.exe to %WINDIR%\notepad.exe.orig
copy %WINDIR%\notepad.exe %WINDIR%\notepad.exe.orig
@echo Replacing Notepad with SciTE
copy Sc1.exe %WINDIR%\System32\DllCache\notepad.exe
copy Sc1.exe %WINDIR%\System32\notepad.exe
copy Sc1.exe %WINDIR%\notepad.exe
@echo Copying SciTE preferences to %WINDIR%\System32
copy SciTE*.properties %WINDIR%\System32
Just pour the script into a batch file in the same folder as Sc1.exe and run. Note that *.properties files are also copied. Thanks David.
Update #3: 2003/10/09
SciTEGlobal.properties was updated to use 'findstr' instead of 'fgrep' for "Search in Files" command. 'findstr' is generally available while 'fgrep' is not.