This guide will explain a simple method of replacing Windows Notepad with another text editor of your choice.
I do a lot of software hacking and a quick text editor with some nice automatic formatting tools for different programming languages is handy. Downloading the text editor and installing it is the same as any other application. The challenge is in getting this new text editor to act as the default application when you right-click on a file and select “Edit with Notepad” or when another program requests Notepad to open.
My preferred text editor is Notepad++. This “How To” will show you how to replace the standard Windows Notepad with Notepad ++, but you can apply this same technique with any text editor that you prefer. This method will completely replace Notepad with Notepad++ and any time that Notepad is requested to be opened, that request is redirected to Notepad++ with a simple VBA program. I’m using this method with Windows 7, but it should work on any operating system since Windows NT.
Update 6-18-2018
I recently had some issues using the method below with a new Windows 10 laptop. There seems to be some security issues with the filepath using the Program Files folder. However, I found another tutorial on-line that works in a very similar way and it seems to work fine for me. Give this alternative a try if the steps below don’t work for you.
The How To
- Download this VBA application.
- Extract the contents of the zip file into your Notepad++ Application folder (i.e. unzip the npp.vba file). Typically the file location would be something like: “C:\Program Files (x86)\Notepad++”
- Open up the Windows registry editor by pushing the Windows button on the taskbar and typing “regedit” .
- Navigate the tree to this key location: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options”.
Note: On 32-bit systems the key will be located here: “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options” - Right-click on “Image File Execution Options” > “New” > “Key”. Name the new key “notepad.exe”
- Right-click on the new key”notepad.exe” > “New” > “String Value”. Name the string value “Debugger”
- Double-click on “Debugger” and enter the value: wscript.exe “C:\Program Files (x86)\Notepad++\npp.vbs” as shown below.
- Exit regedit. Done… Now Notepad++ will open every time that Windows Notepad would have opened before.
Reversing the Change
To reverse this procedure, simply remove the registry key that was created.
Additional Information
If you’d like to use an app other than Notepad++, you will need to tweak the VBA code to use the correct executable file name that opens your specific notepad replacement program.
I discovered this method on another web forum. So, I’d like to give credit to the original developer. The original forum post can be found HERE. Until next time…