Here's a little trick that allows you to replace the inbox Notepad app with a more powerful Notepad++ app. The latter offers more than the default app, which is a simple text editor. Actually, the method we are going to review works with any third-party editor, be it Notepad++, Geany, AkelPad or any other app.
Notepad is a classic app has been included in all versions of Microsoft Windows since Windows 1.0 in 1985. It is suitable for users who occasionally perform basic text editing. Until Windows 11 it didn't receive drastic UI changes and advanced features. But now in Windows 11 it supports tabs, longer undo history, dark theme, document auto-saving, and much more. It has become a Store app.
Advanced users and programmers often use more powerful third-party apps like Notepad++, VS Code, Sublime Text, and so on. Some of them prefer having their favorite editor handle all the text files, for all scenarios and context menus. If you are one of them, this post may be of help. We will see how to make Notepad++ run instead of Notepad all the time.
Notepad++ is a powerful open source plain text editor that comes with tons of useful features, including syntax highlighting, bookmarks, file system navigation, bookmarks, code folding, spell checking, themes, customizable hotkeys, search and replace with regular expressions, and many more. For plenty of users, Notepad++ needs no introduction.
To replace Replace Notepad With Notepad++, you can use one of the following methods.
Replace Notepad With Notepad++ in Windows 11
- Open the Start menu and click All apps.
- In the app listing, find Notepad.
- Right-click the Notepad icon, and select More > Uninstall from the menu. Note: Once it will be removed, Windows 11 will revert to the classic Notepad without tabs.
- Now, open a new command prompt as administrator by typing
cmd
in the Run box and pressing Ctrl + Shift + Enter. - In the command prompt, run the following commands, one by one.
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"%ProgramFiles%\Notepad++\notepad++.exe\" -notepadStyleCmdline -z" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\0" /v "FilterFullPath" /t REG_SZ /d "%ProgramFiles%\Notepad++\notepad++.exe" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\1" /v "FilterFullPath" /t REG_SZ /d "%ProgramFiles%\Notepad++\notepad++.exe" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\2" /v "FilterFullPath" /t REG_SZ /d "%ProgramFiles%\Notepad++\notepad++.exe" /f
- Now type notepad in the Run box or in the command prompt. This will instantly launch Notepad++ instead!
That's it. The modification is helpful in any scenario when you directly call the notepad.exe command. It will also work for the Edit command in the context menu.
It will now be redirect to Notepad++ or any editor of your choice.
Associate .txt files with Notepad++
If you now click on a text file, you may run into an issue that the OS doesn't open it in Notepad++ but shows an error instead like this:
This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default Apps Settings page.
In this very case you need to manually associate Notepad++ with text files. Right-click any text file in File Explorer, and select Open with from the context menu. If you see the Notepad++ in the list, simply click it and then click Always.
However, if the app is missing, you have to click on "Choose an app on your PC" and navigate to the folder where you have the Notepad++ installed.
Select its executable file and click on the Always button in the Open with dialog.
Undo the modification
To undo the change and restore Notepad on Windows 11 for the notepad.exe
command, get done the following steps.
- Open a command prompt as Administrator.
- Run the following commands one by one.
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /f
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\0" /f
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\1" /f
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\2" /f
- Finally, head up over the official Notepad Store page and reinstall it by clicking on the Install button.
For any older Windows version the method is pretty same, but it doesn't involve Notepad removal, and extra Filter* values in the Registry. This was the only new thing to Windows 11.
Here are the details on how to set a custom editor in Windows 10 and older.
Replace Notepad in Windows 10, 8.1/8 and 7
- Press the Win + R keys together on the keyboard, and type cmd in the Run box.
- Now press Ctrl + Shift + Enter on the keyboard to open a new command prompt as Administrator.
- Type or copy-paste the following command.
- If you have a 32-bit Notepad++ app:
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
- If your Notepad++ is a 64-bit app:
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"%ProgramFiles%\Notepad++\notepad++.exe\" -notepadStyleCmdline -z" /f
- If you have a 32-bit Notepad++ app:
- Now, double-click on a text file or type
notepad
in the text box of the Run dialog or Start menu. Voila, this will open Notepad++.
You are done! The command line arguments -notepadStyleCmdline
and -z
do the trick.
To undo the change, use the following command:reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /f
.
Download CMD Files to Save Your Time
Traditionally, to save your time, I have created a set of .cmd files to apply the modification. By using them, you don't need to type the commands manually, edit the Registry, and so on. The cmd files are arranged into folders by the OS version.
Under the Windows 11 folder you will find the files specific for this OS. The Windows 10 and older comes with the files that work in any Windows version released prior to Win11.
So, here are the files:
Download ready-to-use .cmd files
Extract the ZIP archive available by the above link to any folder of your choice.
The first file, replace notepad.cmd
, does what is advertised. You may need to edit it if your Notepad is a portable app or it is installed under a custom folder.
Finally, the second file, undo.cmd
, removes the alterations and makes the notepad command launch the default app.
That's it.
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
The hack make running “notepad” on the RUN dialog result em error.
All I did was change %ProgramFiles(x86)% to %ProgramFiles%, then it worked, since I’m using the 64-bit version of NotePad++. Good luck!
Bit Defender reset it’s setting.
Need run AkelPad from link…
That’s handy. Now the question here’s how to reset the changes and make notepad again the default text editor?
See Step 4.
spasibo , rabotaet.
nexera
+1
The hack make running “notepad” on the RUN dialog result em error.
+ you fortgot “:” before >>> reg
Thanks a bounch..
Only problem, I am using the 64b version of N++, so had to remove ” (86)” from the path..
Otherwise it works
This trick causes notepad++ to open notepad.exe as a text file via the run prompt everytime I call it…
this happens on windows 7 for me, also opens a new ‘z’ file
For everyone coming to the comment section, see: http://web.archive.org/web/20190813012006/https://notepad-plus-plus.org/features/replace-notepad.html
The fact that notepad++ opens notepad.exe as text might be an n++ bug.
I have opened an issue addressing this: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/7996
Thank you! I love Notepad++. It’s so much better then what Windows offers. I always had hoped this was possible to replace. Cheers!
Thanks for hacking Notepad++
It’s work for sheel extension in Windows Explorer to edit a file with notepad++
But, unfortunately, it’s only work for no-space-filename-and-folder only. If the folder or the file contains space, it doesnt work. How to hack it ?
Thanks in advance
Was able to do this successfully in Windows 10. However, does not work in Windows 11. Any workaround?
Sadly there is no way to give notepad++ additional start options this way like -noPlugin next to the needed -notepadStyleCmdline -z. It gets ignored. Don’t now why. I simply want to start notepad++ faster if I just want to open a simple text file.
D:\>reg add “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe” /v “Debugger” /t REG_SZ /d “\”%ProgramFiles%\Notepad++\notepad++.exe\” -notepadStyleCmdline -z” /f
ERROR: Access is denied.
Run this command as administrator