Notepad is a light-weight program suitable for users who need only very minimal text editing features. For advanced functionality, third-party editors like Notepad++ and Sublime Text are awesome with a lot of features built-in. If you’re looking how to replace the plain old Notepad with a third-party text editor of your choice (say, Notepad++), this post tells you how to do it.
Notepad++ is a free source code editor and Notepad replacement that supports several languages. Let’s see how you can replace Notepad with this utility without replacing any system files.
Note: Methods 2 & 3 below can be automated using REG files available at the end of this post.
Method 1: Associate Text Files (.txt) with Notepad++
Create a sample text document on the desktop. Right-click on the file and click Properties.
Click the Change button, select Notepad++ from the list of apps shown, and click OK.
If Notepad++ isn’t listed there, click “More apps” to show the extended list. Notepad++ may not be listed there if you’ve just installed it. If so, click “Look for another app on this PC” and manually browse the Notepad++ folder to select the executable. The default Notepad++ executable path is
C:\Program Files (x86)\Notepad++\notepad++.exe
.txt files will now open Notepad++, and changing file association is sufficient for most users. However, some folks who have the habit of launching Notepad by typing
notepad in Start Run dialog may want the same command to open Notepad++ instead. To accomplish that, follow Method 2 or 3.
Method 2: Redirect Notepad.exe App Path to Notepad++
When you type in a .exe name without the full path in the Run dialog, the Run dialog makes use of the App Paths registry key to find the full path to the executable. So, by changing the Apps Paths registry key, you can make Windows open Notepad++ when typing
notepad in Run dialog.
- Start the Registry Editor (regedit.exe) and go to:
notepad.exeif it doesn’t already exist.
(default)and its data as:
C:\Program Files (x86)\Notepad++\notepad++.exe
Method 3: Replace Notepad with Notepad++ Using Debugger Registry Value
Windows provides a way to attach a “debugger” when a process starts. The
debugger registry value can be used for redirection. Here we’ll discuss two options:
Option 1: Use NotepadReplacer program
NotepadReplacer software from Binary Fortress lets you replace Notepad the easy way! No registry edits needed; the program does that automatically.
Download the NotepadReplacer program and run it.
Choose the Notepad alternative (say, Notepad++) by browsing and selecting the executable, and complete the steps.
This program sets the debugger for Notepad automatically, redirecting it to “NotepadReplacer.exe”, a proxy program which then launches Notepad++ and passes the file name arguments to it.
Option 2: Using a Custom Vbscript
Don’t want to use a third-party proxying program to replace Notepad? No worries. We’ll use a tiny Vbscript to proxy or intercept the file name argument(s) used with Notepad.exe, and pass it on to Notepad++.
- Open Notepad, copy the following lines and paste them:
Set WshShell = WScript.CreateObject("WScript.Shell") If wscript.arguments.count <2 then WshShell.run "notepad++.exe" Else sCmd = "notepad++.exe " & """" & wscript.arguments(1) & """" WshShell.run sCmd End If
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
(default)and change the value data from:
to the following:
Using the "debugger" method, a third-party program or script is necessary to flawlessly route calls for Notepad to a different text editor. Setting Notepad++.exe as the debugger directly causes a little side-effect where Notepad++ attempts to "edit" the Notepad.exe binary everytime when you open a text file. Hence the need for the above script or 3rd party program.
Download replace-notepad.zip, unzip and run the appropriate REG file. There is also an undo.reg file provided if you want to reverse the changes made as per Method 2 or 3.
That's it! After following Method 3, Notepad++ opens whenever you open a text file, either by double-clicking on the file or when notepad.exe is explicitly launched either manually or by a program. Whereas if you followed Method 1 or 2, you can still launch Notepad by mentioning its full path in Run dialog, using shortcut or through other means.
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.