Replace Notepad With Notepad++ or Any Other Text Editor of Your Choice

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.

open with change txt files notepad++

Click the Change button, select Notepad++ from the list of apps shown, and click OK.

notepad++ open with dialog

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

Double-clicking .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:
  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths
  • Create a subkey named notepad.exe if it doesn’t already exist.
  • In the right-pane, double-click (default) and its data as:
  • C:\Program Files (x86)\Notepad++\notepad++.exe

    notepad.exe app paths to notepad++

  • Exit the Registry Editor.

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.

notepadreplacer replace notepad

Choose the Notepad alternative (say, Notepad++) by browsing and selecting the executable, and complete the steps.

notepadreplacer replace notepad

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.

Replace Notepad with Notepad++

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
    
  • Save the file as npp.vbs
  • Move the file to C:\Windows directory.
  • Start the Registry Editor and go to:
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
  • Create a subkey named notepad.exe
  • Under notepad.exe key, create a string value (REG_SZ) named Debugger
  • Double-click Debugger and set its data as follows:
  • c:\windows\system32\wscript.exe "c:\windows\npp.vbs"

    Replace Notepad with Notepad++

  • Then, go to the following key:
  • HKEY_CLASSES_ROOT\txtfile\shell\open\command
  • Double-click (default) and change the value data from:
  • %SystemRoot%\system32\NOTEPAD.EXE %1

    to the following:

    %SystemRoot%\system32\NOTEPAD.EXE "%1"
  • Exit the Registry Editor.

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.

Automate Methods 2 and 3 Using REG files

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.

Leave a Comment

+1
Share1
Tweet
Share
Pin