Replace the Windows Notepad with a Better Notepad

  • July 21, 2006
  • Read 180,547 times
 

Table of Contents

  1. Replacing Notepad with Notepad2
  2. Problems with replacing notepad
  3. Other Notepad replacements
  4. Conclusion

Introduction

Damn you Microsoft! 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 by following the instructions in the tutorial below:

How to see hidden files in Windows

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

Users who read this also read:

  • How to backup and restore your data using Cobian Backup Image
    How to backup and restore your data using Cobian Backup

    As many of you know, today's digital world comes with a lot of things that make our daily life easier. However, as time goes on you rely more and more on the information stored on your PC. No one is completely safe from power outages, corrupt hard disks, an infected system through a backdoor or Trojan, or even a fire. To make sure that a computer can easily be restored to a previous point, ...

  • How to burn or write a CD/DVD image or ISO Image
    How to burn or write a CD/DVD image or ISO

    A CD/DVD image is a file that contains all the information necessary to make an exact duplicate, or clone, of a CD or DVD. Images are created by software that writes every bit of information contained on a CD or DVD into a file on your computer. This file can then be made available for download so that other people can make an exact duplicate or your original CD or DVD on their own computer.

  • How to determine what services are running under  a SVCHOST.EXE process Image
    How to determine what services are running under a SVCHOST.EXE process

    A very common question we see here at Bleeping Computer involves people concerned that there are too many SVCHOST.EXE processes running on their computer. The confusion typically stems from a lack of knowledge about SVCHOST.EXE, its purpose, and Windows services in general. This tutorial will clear up this confusion and provide information as to what these processes are and how to find out more ...

  • How to Backup and Restore your hard drive with DriveImage XML Image
    How to Backup and Restore your hard drive with DriveImage XML

    DriveImage XML is my program of choice for backing up and protecting my data. When I first began using this application, though, I had some difficulties restoring my backup image on my test boxes using the instructions found in other tutorials. Due to this, I pooled info from a variety of available tutorials, and with some work, I was able to figure out how to restore my data. With this in mind, I ...

  • How to fix crashes when you start Notepad++ Image
    How to fix crashes when you start Notepad++

    Notepad++ is a terrific Windows notepad replacement, but just like any application, it sometimes has a problem and no longer starts properly. If you find that Notepad++ is crashing when you start it, in my experience there are typically two things that could be wrong; either a problem with a previous session or a problem with an installed plugin.

 

Comments:

blog comments powered by Disqus
search tutorials
Mandiant mWise Conference 2024

Login