Tuesday, 25 September 2012


Replacing Notepad.exe

l
You want to use your favorite text editor rather than Notepad.  It seems like you could just rename the exe of your favorite to “notepad.exe” and drop it into the Windows directory.  But it won’t work.
First your favorite text editor may not be composed of just one exe file.  Second Windows regards Notepad as part of its installation and Windows Protection will overwrite your text editor at some point.
But there is a way to do it and here it is:
(I’m using Notepad++ as my example text editor. You can alter the various paths and file names to suite your own situation.)
1. Create a cmd file containing these two lines:
@echo off 
start "" "C:\Program Files (x86)\Notepad++\notepad++.exe" %2 %3 %4 %5 %6
Save it in the Notepad++ folder. Call it npplauncher.cmd
2. Open regedit and navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\
3. Add a key under “Image File Execution Options”. Name the key ”notepad.exe”.
4. To the key add a string value with the name “Debugger” and the value “C:\Program Files (x86)\Notepad++\npplauncher.cmd”.
That should do it.  Now just double-click a txt file or type “notepad myfile.txt” at the command line and your text editor will open instead of Notepad.

No comments:

Post a Comment