I stumbled upon a site the other day while looking for a way to permanently replace notepad.exe with Notepad2. I knew there had to be a way to do it easily; a batch file would work, but I couldn’t locate the dll cache on this machine. So none of the batch files I found would cut it. Then I found Sam. He wrote a beautiful—and quite lengthy—batch file that works in either WinXP or Win2k (maybe older OS’s, too, but don’t count on it.) And the coolest thing about it is all you have to do to work it is drag your preferred Notepad replacement onto the batch file and it does its thing.
To get the batch file, visit Sam’s site, highlight the code (it starts with @echo off and ends with :end), paste it into your text editor (if you absolutely must use notepad.exe, remember to change the file type from “*.txt” to “All File Types”), and then save it as “whatever.bat” (minus the quotes, of course.) I named mine notepadreplace.bat so I can remember what it does in the future. Then just drag the executable of your Notepad replacement over the batch file and watch it go. Windows File Protection popped up on my Win2k machine; a simple click of the Cancel button summoned an “Are you sure?” message. Clicking Yes makes it a done deal. Plus, it’s not a one-way street. If you ever decide to revert, simply double-click the batch file and all will be restored. Happy coding!
~Jonathan
Update
I’ve known about both Notepad2 and Notepad++ for a while, but decided on Notepad2 for my replacement simply because I thought it would be quicker. Man, was that a bad move. The long and short of it is I’ve now replaced Notepad2 with Notepad++, and I’ll tell you why.
One of the main reasons I’ve switched from Internet Explorer to Firefox is tabbed browsing (among other things; consequently, Microsoft have followed suit in IE 7). Notepad++ lets you have multiple documents open at the same time, and in separate tabs; how cool is that!

Another thing I’ve noticed is line highlighting and truncating. The program highlights the line of code you’re working on, and it groups nested code. If you don’t need to see the <head> section of your code (or whatever genre of code you happen to be working on), then click the minus next to that tag and watch it go away. Plus there’s the usual code syntax highlighting and line numbering. But the absolute neatest thing I’ve seen thus far (I’ve only been a user for an hour or so) is that it summons the last file or files you were working on. In this case, that ten-line HTML file and its respective CSS file. That’s just the neatest!
To apply Notepad++ to the above batch file, you will need two things: first, download the installer package from the site below and install Notepad++. Then get this file: Notepad++ launcher (ZIP), which can also be found on the Notepad++ downloads page, and use it with the batch file as previously mentioned. Now you’re golden.
Update 2
I am still using Notepad2, however. Notepad++ doesn’t work well with WinSCP, so I’ve got Notepad2 for use when posting web content (the default editor in WinSCP sucks), and I’ve got Notepad++ for use on everything else. Complicated? Nah.
Trackback This Entry
http://jonlandrum.com/old/replacing-notepad-with-your-text-editor-of-choice/trackback/
Leave a Reply