Notepad is a light-weight program suitable for users who need only very minimal text editing features. For additional features and functionalities, third-party editors like Notepad++ and Sublime Text are awesome with a lot of features built-in.
If you’re looking how to completely replace the plain old Notepad with Notepad++ or any third-party editor, 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 Notepad++ without replacing any system files.
(Proceed directly to the RECOMMENDED method.)
How to Replace Notepad with Notepad++ in Windows?
Which of the Methods below should you use?
If you want Notepad++ to open whenever you double-click a text file, and whenever notepad.exe
is executed, follow one of the options under Method 2
. This also means that you can’t run Notepad as long as the setting is in effect.
Whereas if you follow Method 1, you can still launch Notepad by mentioning its full path in Run dialog. You can also open a file with Notepad by choosing Notepad from Open with dialog.
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’re using the portable edition. 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
RELATED: How to Add “Open with Notepad++” to the Right-click Menu in Windows
Double-clicking
.txt
files will now open Notepad++.
Changing the file association is sufficient for most users. However, if you want to completely replace Notepad with Notepad++ so that every call to Notepad will launch Notepad++, follow one of the options listed under Method 2.
Method 2: Replace Notepad with Notepad++ Using Debugger Registry Value
Windows provides a way to redirect a program (process) using the debugger
registry value. Once you redirect a program using this method, every time you launch Notepad by running notepad.exe
directly, or when running a text file, Notepad++ starts instead of Notepad.
Option 1: Using Notepad++’s new command-line
Note: This is the RECOMMENDED method. It doesn’t need a 3rd party program or script.
If you have Notepad++ version 7.5.9
and higher, you can run the following command to make Notepad++ replace Notepad.
- Start an elevated or administrator Command Prompt
- Copy the following command and paste it in the Command Prompt window:
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"%ProgramFiles(x86)%\Notepad++\notepad++.exe\" -notepadStyleCmdline -z" /f
Note that you may need to use “
%ProgramFiles%\Notepad++\
” to substitute for “%ProgramFiles(x86)%\Notepad++\
” if you have Notepad++ 64-bit installed, or use other path if your Notepad++ is installed in a non-default location.After running the command, this is how the
debugger
registry value looks like:You can also modify the above registry value using the Registry Editor (
regedit.exe
) if you don’t prefer the command-line method.To undo (reverse) the replacement, use the following command:
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /f
- Close the Command Prompt window.
Option 2: 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 3: Using a Custom Vbscript
Here is a script method written a long time back and still works. This tiny script intercepts the file name argument(s) used with Notepad.exe, and pass it on to Notepad++ automatically.
- 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"
- 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.
Automate Methods 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.
That’s it! Hope one of the methods above helped you replace Notepad with Notepad++. The methods can also be adopted for any other text editor of your choice.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
Related articles
- Make Cortana Search Google Using Chrome or Default Browser
- How to Always Start Task Manager As Administrator (Elevated) by Default?
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.
thank you.
method2 worked ideally for me
Can’t set font or font sizes
Worked perfectly for me in PowerShell, thanks! Modified the above to the following, that I include in my fresh pc setup:
# Replace Notepad with Notepad++
# See https://www.winhelponline.com/blog/replace-notepad-text-editor-notepad-plus-association/
$registryPath = “HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe”
$name = “Debugger”
$value = “””C:\Program Files\Notepad++\notepad++.exe”” -notepadStyleCmdline -z”
if(!(Test-Path $registryPath)) {
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name -Value $value -Force | Out-Null
} else {
New-ItemProperty -Path $registryPath -Name $name -Value $value -Force | Out-Null
}
Automate Methods Using REG files -> works for me, thanks
HI,
I used the reg add command to replace notepad and it “kind” of works…
The problem I have it’s that it will open ALL FILES on all the folder and SUBfolders of it, so at times Notepad will ask me if I want to open 4567 files and at other times, it will simply open some 20 files, ANY extension including binary files…
Ideas??
2019/10/21
Thanks. Method 2 is exactly what I was looking for.
The only issue is that it automatically opens Notepad++ with a file called notepad.exe.
It seems like notepad.exe from C:\Windows is automatically opened inside Notepad++ by using Method 2.
Also, if you don’t remove ‘ -notepadStyleCmdline -z’ from the value, Notepad++ will try to create an extension-less file named ‘-z’ in your %homepath%.
@Unknow0059: Interesting! The REG.EXE command-line works perfectly to replace Notepad with Notepad++ (without any specified side-effects). Can you tell me which version of Notepad++ you’re using?
Hi thanks, any way to modify the “edit” right click item for extensions .bat .cmd and others, for ++Notepad? The work around is simply to choose “Send To” or to simply open ++ first and drag it in, but I do this MANY times a day (such is my life) and it’s a distraction. Pre-10 Windows had a utility for this but it seems to be gone.
Minor, machine’s ‘Program Files’ directories has a space. Is that intentional or typo? Also, the quotes necessary?
Thanks so MUch