How to Replace Windows Notepad With Another Text Editor (Notepad++)

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

  1. Download this VBA application.
  2. 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++”notepad-replace-0
  3. Open up the Windows registry editor by pushing the Windows button on the taskbar and typing “regedit” .notepad-replace-1
  4. 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”
  5. Right-click on “Image File Execution Options” > “New” > “Key”.  Name the new key “notepad.exe”
  6. Right-click on the new key”notepad.exe” > “New” > “String Value”.  Name the string value “Debugger”
  7. Double-click on “Debugger” and enter the value: wscript.exe “C:\Program Files (x86)\Notepad++\npp.vbs” as shown below.notepad-replace-2
  8.  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…

Leave a Reply