Replace the Windows Notepad with a Better Notepad

I am a notepad addict. If you look at my taskbar at any time and you will see at least 5 notepads, usually a lot more running at one time. Why? Because it is fast and small I use it to keep notes, to do lists, phone numbers, write code, search and replace, etc. The reasons are endless….

What are some of the things I do not like about Windows Notepad:

  • Does not handle large text files well.
  • Does not show line numbers next to each line
  • Does not support advanced search and replace features.
  • Does not open text files from other platforms in a readable manner.
  • Can’t change the background or foreground colors.
  • No good indent support

So what are our options? Replace it with a freeware notepad replacement. For this tutorial we will focus on Notepad2. Notepad2 is a freeware replacement to notepad with the following features:

  • Customizable syntax highlighting
  • HTML, XML, CSS, JavaScript, VBScript, ASP, PHP, CSS, Perl/CGI, C/C++, C#, Java, VB, Pascal, Assembler, SQL, Python, NSIS, INI, REG, INF, BAT, DIFF
  • Drag & drop text editing inside and outside Notepad2
  • Basic regular expression search and replace
  • Useful word, line and block editing shortcuts
  • Rectangular selection (Alt+Mouse)
  • Brace matching, auto indent, long line marker, zoom functions
  • Support for Unicode, UTF-8, Unix and Mac text files
  • Open shell links
  • Mostly adjustable


Notepad2 notepad replacement

Providing a seamless replacement of notepad can be difficult, though, due to Windows XP’s and Windows 2000/2003’s Windows System File Protection (SFP) security feature. What this means is that when you replace a Windows system file with another file, SFP will automatically replace it with the original. I have though, provided some information below that should make it easier to do this replacement.

Replacing Notepad with Notepad2

The goal here is to make working with Notepad2 seem like you are working with the original Notepad by actually replacing notepad.exe with the notepad2 executable. To do this we will rename notepad2.exe to notepad.exe and copy it to the proper locations so as to overcome SFP as described above. Before we do anything, please enable the viewing of hidden system files.

Now we need to download Notepad2 from the following link:

http://www.flos-freeware.ch/notepad2.html

Save it to your hard drive and extract the files to C:\Notepad. Once extracted, rename notepad2.exe to notepad.exe. Now you should have a folder called C:\Notepad that contains the file notepad.exe.

When you have have followed the steps above you need to do the next series of steps. These steps should be done fairly quickly in order to beat SFP at its game. If you go too slow, then SFP may replace notepad.exe with the original Windows notepad. For those who do not want to deal with the instructions below, I have created two batch files that will do all these steps for you and almost always gets past the SFP problem. These batch files can be downloaded from the following link depending on your operating systems:

Notepad Replacement for XP

Notepad Replacement for 2000

As long as you have notepad2.exe saved as C:\Notepad\notepad.exe, then the batch files above should be able to perform the replacement for you. After running the batch file you may get an alert from Windows saying one of your files (notepad.exe) was replaced with another file and asking if you want to restore it. You should press the Cancel button and the Yes button so that it does not replace the file. When done, feel free to delete your C:\notepad folder and hide your files again.

If instead you would like to do this manually, then below are the manual steps that the batch files does for you. These steps should be done in this exact order and as fast as possible to bypass SFP:

  1. Make backup copies of notepad.exe in the following directories (Not necessary but good in case you want to roll back to the original notepad):

    • C:\Windows\System32\notepad.exe

    • C:\Windows\notepad.exe
    • C:\Windows\system32\dllcache\notepad.exe
    • C:\WINDOWS\ServicePackFiles\i386\notepad.exe
    • C:\Windows\System32\dllcache\notepad.exe
  2. Copy C:\Notepad\notepad.exe to all the directories listed above overwriting the notepad.exe that is there.
  3. If Windows will issue an alert stating that the new notepad.exe is not the correct one and if you would like to correct. Press cancel at this prompt and then press Yes as we want to keep the new notepad replacement.
  4. Delete the C:\notepad folder.
  5. Hide your files again.

If these steps did not work, then you should examine the problems section below.

Problems replacing notepad

The above approach may not always work if you have the installation files for Windows XP/2000 available to System File Protection as SFP may use those files to replace notepad as well. If you are running into problems because of this you can check the following registry paths to determine where the OS Source and Service Pack sources files are located. Once you determine that, you can rename those folder temporarily and then do the above procedure again. The registry locations for getting this information are:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\\Installation Sources
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\\ServicePackSourcePath
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\\SourcePath

Other Notepad replacements

If Notepad2 does not turn out to be a notepad replacement that works for you, you can check out the following other free notepad replacements:

A great article with comparisons on the different text editors available can also be found here:

http://en.wikipedia.org/wiki/Comparison_of_text_editors

~ by bestbooter on June 23, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: